Link to home
Start Free TrialLog in
Avatar of dooley090698
dooley090698

asked on

CString exception error in a DLL

I have a class in a DLL.
It is currently dynamicly linked to the MFC's.
This is a code snipet from the base class.
Everytime I try to run it I get an exception error at the line:
ConPath = "ODBC;DSN=Simply: ";
If I comment out this line the next exception error occurs at:
Filename=FOpen.GetFileName();

Seems to be the CString class (and yes I have included the header file for the CString class..:) )

Any suggestions would be appreciated..




class  CAccounts  
{
private:
     
protected:
     long NoAccounts;
     long NoTxs;    
     CTime CurrentUsingDate;
     CString ConPath;
     CString Filename;
//==================================

void CAccounts::OpendataBase()    
{
ConPath = "ODBC;DSN=Simply: ";
CFileDialog FOpen(TRUE,"*.sdb","*.sdb",OFN_HIDEREADONLY,"Simply Data |*.sdb ||");
     
     if (FOpen.DoModal()==IDOK)
     {
     Filename=FOpen.GetFileName();


     Filename = Filename.Left(13);
     ConPath=ConPath+Filename+";UID=sysadmin";    
         
ASKER CERTIFIED SOLUTION
Avatar of Pacman
Pacman
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Is this sutisfied:
You have to use only combinations Debug DLL with Debug App, and Release DLL with Release App.
Avatar of dooley090698
dooley090698

ASKER

Odd thing though is if I change the CString variables to char and use the string manipulation routines (ie strcpy , strlen etc.) all seems to works fine.
Hmmmm....
Oh and this is the debug version btw
well I found the problem...
Would you believe I had declared the class in the main exe but never created an instance of it.....DOH!!!!!
That seemed to clear things up.....
If I keep making STUPID STUPID mistakes like that figure I should maybe take up another hobby!!  :)