Help needed with MFC dll that uses DAO

Help needed with MFC dll that uses DAO

Post by Spoc » Sat, 22 Jul 2000 04:00:00



Hello,

I am getting a very very strange error.  Here's a little description of
my situation.
I am running NT4 and I have a C dll that calls an MFC dll that uses DAO.

Here is the code in the MFC dll:

extern "C" BOOL EXPORTED_DLL_FUNCTION  GetSetupInfo(  TCHAR *szDBase)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

TCHAR *szData=0;
DWORD cbData=0;
CDaoDatabase QuotaDB;

    /* Construct Connection String */
    cbData=_tcslen(szDBase);
    szData=(TCHAR*)realloc(szData,(cbData+21)*sizeof(TCHAR));
    _tcscpy(szData,_T(";DATABASE="));
    _tcscat(szData,szDBase);
    _tcscat(szData,_T(";PWD=HELLO"));
    QuotaDB.Open(0,FALSE,FALSE,szData);
...

I keep getting an Unhandled Exception in Test.exe (Kernel32.dll)
0xE06D7363 Microsoft C++ Exception error
after running the last line in the snippet above.

Does anybody have any ideas about this error?

Thanks for any help
Shaun Planiden

 
 
 

1. MFC DLL using DAO

I have to query a .MDB database for some data: since my program is written
in C, i want to use MFC DAO support for writing a DLL that retrieves these
data to C. I will pass to it the name of the database, a SQL query and i
want back a list of records.

The little problem is this: I'M NOT A C++ PROGRAMMER

Anybody knows were i can find sample code similar to the one i have to
write (DAOVIEW and other samples from Microsoft are too big)? This would
reduce the amount of time i have to spend for learning
C++.

THANK YOU.

Luca Garagnani

2. Business Objects

3. Strange Debug/Release Differences for MFC DLL using DAO

4. Query Designer encountered a Query error

5. Help: finding the right set of MFC/DAO DLLs

6. REQ Advice: Should I take SQL Admin(28) & SQL Design(29) to get to MCSE + I ???

7. Help: DAO in DLL (static link to MFC) causes Heap assert

8. Query Optimser puzzler

9. Help:Database programming using MFC DAO

10. need help on creating installation of MFC DAO application

11. Runing DAO DLL in non-MFC application

12. Problem terminating DAO from MFC DLL

13. How do I use DAO using C without MFC