By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

How to write a callback routine for a clr ext from an unmanaged dll?

P: 2
I always get -- unresolved external symbol "public: void __thiscall CMObject::TriggerEvent(int)" (?TriggerEvent@CMObject@@QAEXH@Z) when compiling the unmanaged dll.
Dec 11 '10 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 5K+
P: 9,197
An "unresolved external" is a link error and not a compile error.

Your dll project is missing either code for CMObject or a library that has that code in it.
Dec 11 '10 #2

P: 2
I understand. I am passing the address of CMObject to the dll. If I add the cpp code for CMObject to the dll, the control will go to that code instead of the code in the .exe ( where is what I want it to do).
Dec 11 '10 #3

Expert Mod 5K+
P: 9,197
Yes. That's what you want.

The dll has the code for CMObject so that you can call functions in the dll using a CMObject*.

Otherwise, from the dll viewpoint, what is a CMObject*. Hence your link error.

I'm not sure what you mean by "control". When you run your program, the line of control is the thread through main(). When you call a function, the thread passes to that function. That is, main() stops while the function runs. It's irrelevant whether the function is in your code, the dll code or some other library code.
Dec 12 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.