|
Thanks for your wonderful pearls of wisdom.
It must be nice to know everything and never be in need of asking a question, especially when helpful suggestions made don't bear fruition.
I had an issue, I asked a question, and someone was kind enough to work with me to get a result. Is that not what these forums are about?
|
|
|
|
|
Sorry, I thought I was being helpful: You have an owner-draw listbox. Therefore, you are doing the drawing. If it's not drawing the way you want, then you need to look more carefully at your drawing code. Since you didn't post your drawing code, it's not clear what further assistance was possible.
|
|
|
|
|
I doubt it's part of the problem, but is there any reason why you are creating a heap-based CCustomListBox object?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi David,
The answer to that question is that my DIalog design wasn't working, and I was wondering whether it was to do with creation etc, and I didnt go back to it yet.
As I'm getting the same results as with my original design, I will go back to it.
Either way, the tab stops dont seem to want to work
Tony
|
|
|
|
|
Hello All
I getting exception while I use
mysql_fetch_field .I use debug then I found when table rows is more than 229000 then Iam getting exception in this line
field1=mysql_fetch_field(res1); .
Unhandled exception at 0x10010d74 in SQLconvert.exe: 0xC0000005: Access violation reading location 0x00000040.
Call stack shows
libmySQL.dll!10010d74()
[Frames below may be incorrect and/or missing, no symbols loaded for libmySQL.dll]
> SQLconvert.exe!CSQLconvertDlg::EnumRow(ATL::CStringT<char,StrTraitMFC<char,ATL::ChTraitsCRT<char> > > tab="sheet1") Line 1400 + 0xc bytes C++
SQLconvert.exe!CSQLconvertDlg::Convert() Line 1147 C++
SQLconvert.exe!readThread(void * p=0x0012f254) Line 56 C++
SQLconvert.exe!_AfxThreadEntry(void * pParam=0x0012e5c0) Line 109 + 0xf bytes C++
SQLconvert.exe!_callthreadstartex() Line 348 + 0xf bytes C
SQLconvert.exe!_threadstartex(void * ptd=0x003fd628) Line 331 C
kernel32.dll!7c80b699()
code is here
QueryResultsPtr Qry;
MYSQL_FIELD *field1;
MYSQL_RES *res;
enum enum_field_types type;
if (!mysql_query(conn," SELECT * FROM tes"))
{
res = mysql_store_result(conn) ;
int numrows = (int)mysql_num_rows(res);
int numflds = (int)mysql_num_fields(res);
while (row = mysql_fetch_row(res))
{
res1=mysql_list_fields(conn,tab,"%");
for(long y=0; y<numflds; y++)
{
str2.Empty();
field1=mysql_fetch_field(res1);
if(field1->flags & AUTO_INCREMENT_FLAG)
continue;
str2+=(LPTSTR)row[y];
type=field1->type;
}
}
}
|
|
|
|
|
It may be a bug, but I don't think that you need to SELECT * from the huge table, why do not where something to reduce fetched rows?
try to use mysql_use_result() rather than mysql_store_result() to see if the problem can be fixed.
BTW: mysql_num_rows() is invalid if using mysql_use_result().
|
|
|
|
|
MsmVc wrote: int numrows = (int)mysql_num_rows(res);
res is an uninitialised pointer and is probably pointing to some random memory location. If mysql_num_rows() attempts to write anything to the memory pointed by res , the Universe will end.
Why can't you try this instead?
MYSQL-RES res;
...
mysql_num_rows(res);
That applies to other pointer variables as well.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
sorry
res is an initialised Globel MYSQL_RES *res;
|
|
|
|
|
MsmVc wrote: res is an initialised Globel MYSQL_RES *res;
The results will still be the same, won't it be? I do not know if the method that accepts that particular pointer will do a write operation to it, or probably call some method on it if it's a class object.
Either ways, how do you expect an uninitialised pointer to work? Try creating the variable on the stack and use it instead.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
sir
my code is working fine when table rows is less than 229000.I am getting error when table rows is more than 229000.
So there is no need to discusses about res is an initialised or uninitialised.Matter is why
mysql_fetch_field(res1); generating exception if table rows is more than 229000.
Plz help me
|
|
|
|
|
did you try to use mysql_use_result() rather than mysql_store_result()?
do you know the difference of the 2 functions? why do not try it?
|
|
|
|
|
when i use mysql_use_result() then i am getting exception on line
field1=mysql_fetch_field(res1);
0xC0000005: Access violation reading location 0x00000040.
|
|
|
|
|
i created one dialog based application. In that Dlg App class i am calling RegisterShellFileTypes(), in CWInApp::initInstace.
But application is crashing due to no poniter to document class.
code is like this :
CDesktopWallpaperDlg dlg;
m_pMainWnd = &dlg;
EnableShellOpen();
RegisterShellFileTypes();
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
so, can anyone tell me what is the problem exactly?
it working with SDI Application..
Regards,
Srinivas
modified on Thursday, December 3, 2009 6:24 AM
|
|
|
|
|
The problem is precisely what the error message says. RegisterShellFileTypes creates registry entries to associate a document type and file extension with an .exe. If you aren't using the MFC DocView framework, there is no document class and the function call fails.
You can make the same registry entries manually; just because you aren't using the DocView framework doesn't mean you can't associate a file extension with an app, it just takes a bit more code.
|
|
|
|
|
when i call this RegisterShellFileTypes() in App Class,
internally in this function defination having pointer of document class.
but dlg based application doesn't have doc class. so that,
pointer is becoming NULL.
void CWinApp::RegisterShellFileTypes(BOOL bCompat)
{
ASSERT(m_pDocManager != NULL);
m_pDocManager->RegisterShellFileTypes(bCompat);
}
but,it is working fine with SDI Application.
i have tried in one sample SDI application.
Regards,
Srinivas
|
|
|
|
|
Yeah.... and what does SDI stand for? 'Single Document Interface'. It works in an SDI app because the SDI app has a document class, and fails in your dialog app because it doesn't have a document class.
|
|
|
|
|
I know what is the SDI stand for..
what iam asking that, how to do in dialog based.
i created one reg file. but
what should be write in reg file instead of document class does.
Regards,
Srinivas
|
|
|
|
|
It seems RegisterShellFileTypes() is to be used with SDI or MDI apps only.
|
|
|
|
|
what dll is relayed to the compile error?
|
|
|
|
|
The one that's missing from your project, i.e maybe IWshRuntimeLibrary!
|
|
|
|
|
IWshRuntimeLibrary works fine.
|
|
|
|
|
includeh10 wrote: IWshRuntimeLibrary works fine.
So are you saying that the title of this message "unresolved external symbol public: long __thiscall IWshRuntimeLibrary::IWshShortcut::Save(void)" has been fixed?
|
|
|
|
|
no,
IWshRuntimeLibrary::IWshShellPtr raw_CreateShortcut() works fine before the missed link LNK2001.
I think I need to import some dll file, but I don't know which one.
|
|
|
|
|
I have looked at MSDN but cannot find a direct reference to this library. I can only suggest you go back to your documentation and recheck the format of the Save() command.
|
|
|
|
|
Hi i m working in MFC dialog based application i want to resize the window according to screen resolution ( i m using win XP)
so that the application must be maximized
and the controls be resized accordingly on initialization
plz guide
uzmeed
|
|
|
|