|
VB uses BSTRs I believe, so use temporary CComBSTR variables in your call:
ptr->MakeDB ( CComBSTR(LPCTSTR(myFile)), CComBSTR(LPCTSTR(dbName)) );
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
That looks like a cool solution. MAny many thanks.
|
|
|
|
|
Unfortunately the compiler didnt like the CComBSTR either...
Thanks anyways.
ns
|
|
|
|
|
Hi,
I've been programming in VC++ for a while now and I'm pretty good at it, but I've only been dealing with the coding aspect C++. Now I want to make a GUI front end for the programs I wrote. Where can I learn about making a GUI front end for VC++? Is there a place where I can download really simple sample code and programs? Thanks in Advance
|
|
|
|
|
WhiteLegend wrote:
Is there a place where I can download really simple sample code and programs?
Um... yes, it's called CodeProject.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
yeah ravs right.. there are tutorials located right here at codeproject..
xai
|
|
|
|
|
I have a VB COM dll that I call from my MFC app with an #import statement, but its not known where the program wil be installed. If I get the appDir from the app, I cant really build a #import pathName + '\' + filename since this statement is outside the code. I suppose I could force the user to put the COM dll into one of the Program files subfolders (via the WISE installer), so is it safe to assume very windows user has this directory? Not everyone has a system32 folder - is that right?
How to safeguard against this: if the #import has a bad pathname (for whatever reason). What sort of errors does one get and whats a graceful exit?
Thanks,
ns
|
|
|
|
|
#import is a compile-time thing, not runtime. Use the path to the file on your machine.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I wont know where the user will install the app, so the dll cant be put in the app folder on the target machine. Thats why I'm wondering if I should install it in their system folder (since my com dll is not an ADO dll though it is database related...):
#import "c:\Program Files\Common Files\system\ado\msadox.dll" no_namespace
#import "c:\Program Files\Common Files\system\myVBCOM.dll" no_namespace
I have control over where WISE installs the dll, but the user can choose his own directory for the app, so thats an unknown.
|
|
|
|
|
#import is compile-time. All that matters is where the DLL is on your machine. When your app creates the COM objects, the location of the DLLs doesn't matter because COM looks in the registry to get the file paths.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Mike,
Could you rephrase that one last time please
jon
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Hello,
When I am declaring CSocket in VC++, what .lib should I include in the link?
Thanks!
Nachi
|
|
|
|
|
Normally, only MFC libraries will suffice. If you're developing your own CSocket, you can #pragma comment(lib, "ws2_32.lib")
Concussus surgo.
When struck I rise.
|
|
|
|
|
|
For that matter I dont know how one can debug a VC dll called from VC. But at the moment I have a VB dll that I'm calling from VC. I'm putting msgboxes in the dll and rebuilding each time, but its really inefficient. How to do this the right way?
Thanks,
ns
|
|
|
|
|
We don't really understand where your orblem lies, or did you mean to reply to someone?
With time we live, with money we spend!
Joel Holdsworth.
|
|
|
|
|
Sorry I was terse. I need to know how one can "step into" the code of a VB dll called from VC to see whats wrong. Is this even possible?
(Can this be done if VC is calling a VC dll? ). I am suspecting that the private declares in my VB dLL may need to be changed to public but I dont know VB so I am off to investigate. Hope I'm clearer this time
|
|
|
|
|
Hi Again,
In my memory, isn't visual basic separte from the dev studio ide? consequently if you do try and step into a VC dll, you'll be confronted with assembly instructions. So you may be up the creak there. Unless you can convince VB to make your VC program the executing program for your dll. So you ask VB to run the DLL by running the C++ program, in which case you can make it halt just at the beginning of the appropriate function. Failing that I think you are reduced to making your dll flash up MessageBoxes to trace out the problem! Sorry I don't know anything more useful...
With time we live, with money we spend!
Joel Holdsworth.
|
|
|
|
|
THe VC app is calling the VB dll. Thanks for your input anyways. I'm putting in messageBoxes....
|
|
|
|
|
Joel Holdsworth wrote:
In my memory, isn't visual basic separte from the dev studio ide?
It is, but the VC debugger as capable og debugging both C++, VB and Java.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
On Visual Basic, on "Project Properties" Dialog, Select "Compile" tab, check "Compile to Native code", "No optimization", "Create Symbolic Debug Info"
Concussus surgo.
When struck I rise.
|
|
|
|
|
I have only done it with COM Objects written in VB and used from VC.
You go into your VB project settings and tell the compiler to generate debug info (.dbg-files I think), and you have to turn optimation off.
Then you place the .dbg-files and your dll in the same place, and from the VC debugger you just step into the code. The first time you do that, it asks for the VB source. Works perfectly fine, I have done it a couple of times with COM Objects written in VB...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
OKay then,
heres another question, Debug a VB application that is calling code from a VC++ DLL...
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
Have never tried, but I guess it should be possible to debug a VB .exe from VC...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Appreciate it. Am trying it out now,
thanks,
ns
|
|
|
|