Winsparkle with managed c++

91 views
Skip to first unread message

lok...@gmail.com

unread,
Apr 10, 2014, 4:08:34 PM4/10/14
to winsp...@googlegroups.com
Hello All,

I'm having trouble linking winsparkle to my managed c++ windows form project. Following the Basic Setup page, I attempted to follow the instructions for native c++ applications but it didn't work (I guess that was obvious). The section under managed/.Net/C# applications give an example of a wrapper that needs to be implemented to get it to work - would implementing this wrapper in managed c++ context do the trick? Also, I cannot seem to add a reference to WinSparkle.dll - says it is neither a .NET assembly or registered activeX control. I obviously am doing this wrong...

Just for reference, I have the error messages I get from attempting the native c++ instructions

1>iFU.obj : error LNK2031: unable to generate p/invoke for "extern "C" void __clrcall win_sparkle_cleanup(void)" (?win_sparkle_cleanup@@$$J0YMXXZ); calling convention missing in metadata
1>iFU.obj : error LNK2028: unresolved token (0A00000E) "extern "C" void __clrcall win_sparkle_cleanup(void)" (?win_sparkle_cleanup@@$$J0YMXXZ) referenced in function "private: void __clrcall iFU::Form1::Form1_FormClosing(class System::Object ^,class System::Windows::Forms::FormClosingEventArgs ^)" (?Form1_FormClosing@Form1@iFU@@$$FA$AAMXP$AAVObject@System@@P$AAVFormClosingEventArgs@Forms@Windows@4@@Z)
1>iFU.obj : error LNK2019: unresolved external symbol "extern "C" void __clrcall win_sparkle_cleanup(void)" (?win_sparkle_cleanup@@$$J0YMXXZ) referenced in function "private: void __clrcall iFU::Form1::Form1_FormClosing(class System::Object ^,class System::Windows::Forms::FormClosingEventArgs ^)" (?Form1_FormClosing@Form1@iFU@@$$FA$AAMXP$AAVObject@System@@P$AAVFormClosingEventArgs@Forms@Windows@4@@Z)
1>C:\Code Projects\iFU\trunk\Debug\iFU.exe : fatal error LNK1120: 2 unresolved externals

I'm really new at this, so I just want to say thanks for everyone's patience in advance. Hope I can get winsparkle working soon.

lok...@gmail.com

unread,
Apr 10, 2014, 4:10:48 PM4/10/14
to winsp...@googlegroups.com
I forgot to mention I am running VS2008.

Thanks,
Lok Tin

Václav Slavík

unread,
Apr 11, 2014, 3:10:28 AM4/11/14
to winsp...@googlegroups.com

On 10 Apr 2014, at 22:08, lok...@gmail.com wrote:
instructions for native c++ applications but it didn't work (I guess that was obvious). The section under managed/.Net/C# applications give an example of a wrapper that needs to be implemented to get it to work - would implementing this wrapper in managed c++ context do the trick?

I don’t know. WinSparkle is a native library like any other, so follow the documentation on using native libraries in managed C++, I guess. I’d be interested in hearing back when you make it work, but I don’t have any experience with using C++/CLI myself, yet.

Vaclav

Lok Tin Lam

unread,
Apr 11, 2014, 2:01:47 PM4/11/14
to winsp...@googlegroups.com
Thanks for getting back to me Vaclav. I figured it out. I needed to change the compiler settings from /clr:pure to /clr so it accepts both managed and native code. No need to do any wrapper. 

Cheers!


--
You received this message because you are subscribed to a topic in the Google Groups "WinSparkle" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/winsparkle/MAbMb5iXELg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to winsparkle+...@googlegroups.com.
To post to this group, send email to winsp...@googlegroups.com.
Visit this group at http://groups.google.com/group/winsparkle.
For more options, visit https://groups.google.com/d/optout.



--
Lok Tin Lam
B.A. Sc. Mechanical Engineering, Mechatronics Option
University of British Columbia

Reply all
Reply to author
Forward
0 new messages