Click here to Skip to main content
15,914,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralComposite Control Pin
KingsGambit24-Aug-01 20:53
KingsGambit24-Aug-01 20:53 
Generalregarding flexgrid and mfc dialog based Pin
Cnoob24-Aug-01 18:23
Cnoob24-Aug-01 18:23 
GeneralSimple Toolbar Question. Pin
Mike Doner24-Aug-01 17:33
Mike Doner24-Aug-01 17:33 
GeneralRe: Simple Toolbar Question. Pin
Ben Burnett24-Aug-01 18:00
Ben Burnett24-Aug-01 18:00 
QuestionConvert FILETIME to DATE for ADO ? Pin
Christian Graus24-Aug-01 16:35
protectorChristian Graus24-Aug-01 16:35 
AnswerRe: Convert FILETIME to DATE for ADO ? Pin
Ben Burnett24-Aug-01 16:48
Ben Burnett24-Aug-01 16:48 
AnswerRe: Convert FILETIME to DATE for ADO ? Pin
Carlos Antollini24-Aug-01 16:55
Carlos Antollini24-Aug-01 16:55 
GeneralADO/ATL problems - my life is hell. Pin
Christian Graus24-Aug-01 16:32
protectorChristian Graus24-Aug-01 16:32 
I have got filtering working in my recordset but I have some real problems.

1/ I'm not sure how all the string types/functions fit together. I've read the chapter in ATL Internals, but it does not appear to have gelled. I'm trying this:

CComBSTR bstrPath;
(*it)->get_FilePath(&bstrPath);

char * pStr = new char[bstrPath.Length() + 20];
memset(pStr, 0, bstrPath.Length() + 20);

sprintf(pStr, "FilePath = '%s'", (_bstr_t)bstrPath);

MessageBox(NULL, pStr, "", 0);


If I
ATLTRACE(bstrPath)
the value coming in is OK, but the value in the message box is garbage. What am I missing ?

Also, I get my string together like this:

CComBSTR query = "FilePath = '";
query.Append(bstrPath.Copy());  // I initially forgot .Copy(), but it crashes both ways
query.Append("'");

records->Filter = (_bstr_t)query;


Now my string is as I want it to be, but the program crashes on the Filter call. I know I'll get a crash if I pass in bad SQL, but if I pass in the same string verbatim, it works fine. What's wrong with passing in the string as a variable, with the same value ? If I do this:

_bstr_t bquery = "FilePath = 'f:\\biblio1.mdb'";

records->Filter = bquery;


then it appears to work fine, so I presume it's back to me not getting the string thing...

Please help - I'm going mad here.....


Christian

As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.

Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
GeneralRe: ADO/ATL problems - my life is hell. Pin
Carlos Antollini24-Aug-01 16:49
Carlos Antollini24-Aug-01 16:49 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Christian Graus24-Aug-01 17:03
protectorChristian Graus24-Aug-01 17:03 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Carlos Antollini24-Aug-01 17:11
Carlos Antollini24-Aug-01 17:11 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Christian Graus24-Aug-01 17:27
protectorChristian Graus24-Aug-01 17:27 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Christian Graus24-Aug-01 20:05
protectorChristian Graus24-Aug-01 20:05 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Carlos Antollini25-Aug-01 5:05
Carlos Antollini25-Aug-01 5:05 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Ben Burnett24-Aug-01 17:39
Ben Burnett24-Aug-01 17:39 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Christian Graus24-Aug-01 17:51
protectorChristian Graus24-Aug-01 17:51 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Ben Burnett24-Aug-01 18:15
Ben Burnett24-Aug-01 18:15 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Christian Graus24-Aug-01 18:21
protectorChristian Graus24-Aug-01 18:21 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Michael Dunn24-Aug-01 18:20
sitebuilderMichael Dunn24-Aug-01 18:20 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Christian Graus24-Aug-01 18:26
protectorChristian Graus24-Aug-01 18:26 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Ben Burnett24-Aug-01 18:38
Ben Burnett24-Aug-01 18:38 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Christian Graus24-Aug-01 20:03
protectorChristian Graus24-Aug-01 20:03 
GeneralRe: ADO/ATL problems - my life is hell. Pin
Tim Deveaux25-Aug-01 14:54
Tim Deveaux25-Aug-01 14:54 
GeneralRe: ADO/ATL problems - my life is hell. Pin
24-Aug-01 23:20
suss24-Aug-01 23:20 
GeneralGetMenuItemInfo Pin
24-Aug-01 16:06
suss24-Aug-01 16:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.