DLL Function in VB
-
When trying to call a dynamically declared .dll function, i pass in a String, but when i debug it inside of VC, it's junk ("????????????????") anyone see that happen before? and know how to fix that in an already made ATL Object in VC? ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
-
When trying to call a dynamically declared .dll function, i pass in a String, but when i debug it inside of VC, it's junk ("????????????????") anyone see that happen before? and know how to fix that in an already made ATL Object in VC? ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
Can you give a small example of code (C++/ATL and VB) that gives this behavior? I remember having this sort of problem, but I don't remember how I solved it ;) (Though I did solve it, so maybe I'll be able to help :) ) Volodya Orlenko, orlenko [at] hotmail [dot] com
-
Can you give a small example of code (C++/ATL and VB) that gives this behavior? I remember having this sort of problem, but I don't remember how I solved it ;) (Though I did solve it, so maybe I'll be able to help :) ) Volodya Orlenko, orlenko [at] hotmail [dot] com
Ok, well first I created an ATL COM AppWizard .dll, and then created an ATL Object. Then in CMyObject(not IMyObject) I created a function that had a BSTR for a parameter (just input) and i tried setting the return value to "void _stdcall" and "void __declspec(dllexport)" and then going into the .def file, i added the appropriate function names and added the "@number" after each, but when i run it in my VB program, and debug the dll from VC++, it will either have "" <-- nothing in the string (and i've debugged from vb and there is stuff passed in) or mumbojumbo that either looks like: "?????????????????????????" or "?[the return character] <-- this repeated a bunch" and then it'll crash when i close it or whatever. I'm trying it in a regular dll now, but i would rather just make the small changes to the object's functions. Any help would be grand! I'm glad someone else has at least had this happen before, so any help/advise is awesome thanks ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
-
Ok, well first I created an ATL COM AppWizard .dll, and then created an ATL Object. Then in CMyObject(not IMyObject) I created a function that had a BSTR for a parameter (just input) and i tried setting the return value to "void _stdcall" and "void __declspec(dllexport)" and then going into the .def file, i added the appropriate function names and added the "@number" after each, but when i run it in my VB program, and debug the dll from VC++, it will either have "" <-- nothing in the string (and i've debugged from vb and there is stuff passed in) or mumbojumbo that either looks like: "?????????????????????????" or "?[the return character] <-- this repeated a bunch" and then it'll crash when i close it or whatever. I'm trying it in a regular dll now, but i would rather just make the small changes to the object's functions. Any help would be grand! I'm glad someone else has at least had this happen before, so any help/advise is awesome thanks ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
If I understand you correctly, you created an ATL Dll, a COM object in it, and now you want to use its methods just as dll functions, without that COM object at all? That will not work. To create a simple dll to be used from VB or C or whatever, you do not need ATL. Use "New", then select "Win32 Dynamic-Link Library" in your Visual C++. Volodya Orlenko, orlenko [at] hotmail [dot] com
-
If I understand you correctly, you created an ATL Dll, a COM object in it, and now you want to use its methods just as dll functions, without that COM object at all? That will not work. To create a simple dll to be used from VB or C or whatever, you do not need ATL. Use "New", then select "Win32 Dynamic-Link Library" in your Visual C++. Volodya Orlenko, orlenko [at] hotmail [dot] com
The thing is, is that I can get into the Function though, and debug through it, I tried using a function outside of the ATL object as well, but it still wouldnt work. Check this article out, do you see anything that he might be forgetting to tell me? http://www.codeproject.com/dll/superdll.asp#xx77114xx ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
-
The thing is, is that I can get into the Function though, and debug through it, I tried using a function outside of the ATL object as well, but it still wouldnt work. Check this article out, do you see anything that he might be forgetting to tell me? http://www.codeproject.com/dll/superdll.asp#xx77114xx ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
Ok, I see what you ae trying to do. Please download that example and modify it for your needs. It works. Note that he did not use any COM classes! You could do exactly the same by creating a new dll from scratch. Volodya Orlenko, orlenko [at] hotmail [dot] com
-
Ok, I see what you ae trying to do. Please download that example and modify it for your needs. It works. Note that he did not use any COM classes! You could do exactly the same by creating a new dll from scratch. Volodya Orlenko, orlenko [at] hotmail [dot] com
Yeah, that is a totally an awesome thing, but i got my ATL Class to work! In MSDN, if you're messing with strings, it says to use LPSTR when you're recieving a string, and it worked! and that is a public function inside a ATL Class, so it's something else to remember... ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
-
Yeah, that is a totally an awesome thing, but i got my ATL Class to work! In MSDN, if you're messing with strings, it says to use LPSTR when you're recieving a string, and it worked! and that is a public function inside a ATL Class, so it's something else to remember... ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
ATL objects are COM objects. You've got to create an instance of a class to use its functions. In general, you cannot use a member function of your C++ class without creating an instance of that class. It looks like you try to use member functions without creating any variables of that object's type. Volodya Orlenko, orlenko [at] hotmail [dot] com