|
-
Aug 7th, 2002, 02:51 PM
#1
Thread Starter
Addicted Member
-
Aug 8th, 2002, 09:29 AM
#2
Frenzied Member
VB dll's require the VB run-time & VB virtual machine to be activated, plus, VB-made dll's are COM objects, so you have to call CoInitialize();
-
Aug 8th, 2002, 09:38 AM
#3
Thread Starter
Addicted Member
Here is what I do:
HRESULT hresult;
CLSID clsid;
CoInitialize(NULL); //initialize COM library
hresult=CLSIDFromProgID(OLESTR("ValidateCard.Validate"), &clsid); //retrieve CLSID of component
_Validate *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_Validate),(LPVOID *) &t);
if(FAILED(hresult))
{
AfxMessageBox("Creation Failed");
return;
}
______________________________________________
and this works fine when I run C++ code.
But it Failes to create object if I run it from vb Code.
How do you run it from vb to debug it ?
-
Aug 8th, 2002, 09:54 AM
#4
Frenzied Member
In your VB project, set a reference to the .dll, .OCX or .EXE.
Code:
Dim vcard as New Validate ' assuming the class name is validate
............... mess with it here
Is this what you mean?
You can check to make sure what the class is by using F2 - the Object Browser, after you have added the reference.
-
Aug 8th, 2002, 10:24 AM
#5
Thread Starter
Addicted Member
-
Aug 13th, 2002, 06:04 AM
#6
You could create a small VB exe for test purposes only.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 13th, 2002, 08:12 AM
#7
Thread Starter
Addicted Member
-
Aug 13th, 2002, 08:47 AM
#8
Thread Starter
Addicted Member
-
Aug 14th, 2002, 08:07 AM
#9
Hyperactive Member
I'm sure you're aware of this, but if you compile your vb project with debug symbols, you can step thru the vb code from the c++ debugger.
td.
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|