DLL Function in VB
-
Hey, I've created an ATL object in a .dll, and i am trying to call the function dynamically. How do i need to setup my functions to get them to not give back crappy values (my BSTR="?????????????????????????????") i tried __stdcall or _export but nothing is working. i also have "ByVal" for the parameter in my function definition in the VB section. ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
-
Hey, I've created an ATL object in a .dll, and i am trying to call the function dynamically. How do i need to setup my functions to get them to not give back crappy values (my BSTR="?????????????????????????????") i tried __stdcall or _export but nothing is working. i also have "ByVal" for the parameter in my function definition in the VB section. ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
Is the ATL object a COM object, if so then you simply need to declare your class inside of the type library that is created in your idl file of your project. Then you can go to the Project | references menu item in your VB project in order to reference your COM object. From there you can use that object in VB just like any other object. If you are actually exporting an object like you say rather than a function, you would need to instantiate an instance of this object before it can be used, and I do not know of a way to use a C++ object in VB except through COM. If this is what is happening, I am surprised that your program is not crashing.