|
Thanks David,
Question answered.
regards,
George
|
|
|
|
|
Hi,
I am running 32 bit code I just used depends on dbghelp.dll
and noticed a function StackWalk can I use this if so same parms
as StackWalk64
|
|
|
|
|
I just checked and both function prototypes have the same signature. So I would hazard a guess that they work the same. Looks like all of the 64 bit DBG functions have a postfix of '64' to distinguish them.
Best Wishes,
-David Delaune
|
|
|
|
|
So if I am running 32 bit windows this isn't going to work
|
|
|
|
|
I am beginning to question my comprehension of your original question.
*takes out his crystal ball*
If you were asking if you can call the 32 bit function on a 32 bit platform in the same way as the 64 bit function on a 64 bit platform then the answer appears to be 'Yes'.
If you were asking if you can call StackWalk on a 64 bit platform then the answer is 'No' and vice versa.
Hope this helps!
-David Delaune
|
|
|
|
|
Sorry I wasn't being clear
Anyway I found code demo called Stackwalk.cpp
Which loads imagehlp.dll gets the address of a number of
functions including Stackwalk and seems to work on my 32 bit windows
Thankx for yor help
|
|
|
|
|
Hex equivalent of character ‘ø’ is “f8”, but I’m getting the result “fffffff8” in szArr after execution of following statement.
sprintf(szArr, "%x", 'ø');
Can anyone please tell me what am I doing wrong?
This problem occurs with "Extended ASCII Codes"
Thanks,
Mushq
modified on Sunday, April 13, 2008 12:25 AM
|
|
|
|
|
|
Thanks for the useful info.
Regards,
Mushq
|
|
|
|
|
The console application for a project I'm working on has some threads running. When a certain event happens in one of those threads, it inserts a line into the console. But while they are waiting for an event, the user is presented with an input thing, to type text (using cin.getline).
So I need to replace the current line (with the input ... cin.getline stuff) with the text returned from the event. I think I can do this okay, but i need to move the input prompt down to the next available line in the console - WITHOUT the user having to retype anything they may have typed already.
How could I do this? Thanks for any help!
|
|
|
|
|
I passed the following string as "Connection String" to a CDatabase object:
<br />
strConnection.Format(<br />
_T("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=%s\\Profiles\\%s.mdb;PWD=MyPswrd;", wInstallPath, wCurtProfile));<br />
<br />
CDatabase *pdb=new CDatabase;<br />
pdb->Open(strConnection);<br />
But the follwoing error appears:
"Data Source Name Too Long."
Can U help me PLS?
|
|
|
|
|
how long?
wqewqqeweqwrwerewrwe
|
|
|
|
|
as long as your tail!
Sorry gentelmen! He/She need it!
modified on Saturday, April 12, 2008 2:24 PM
|
|
|
|
|
Usef Marzbani wrote: CDatabase *pdb=new CDatabase;
Why are you creating this on the heap? It has nothing to do with your problem, but it is an unnecessary bother of Windows' memory manager.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Is it safe to use OnNewWindow2 on multithread ?
For example, one thread's WebBrowser fire NewWindow2 and let another
thread's application take the Dispatch pointer ?
AthreadWebBrowser::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel)
{
Cancel = FALSE;
HRESULT hr;
CoInitializeEx(NULL,COINIT_MULTITHREADED);
LPSTREAM pStream = NULL;
hr = ::CoMarshalInterThreadInterfaceInStream(IID_IDispatch,*ppDisp,&pStream);
if(hr != S_OK)
{
AfxMessageBox("couldn't get interface");
}
}
but it's failer
wqewqqeweqwrwerewrwe
|
|
|
|
|
Hi Masters!
Can I set CRecordset::m_pDatabase explicitly, I mean something like:
<br />
CDatabase *pdb=NULL;<br />
CRecordsetDerived rd;<br />
<br />
void Initialization()<br />
{<br />
pdb=new CDatabase;<br />
pdb->Open(_T("Connection String"));<br />
<br />
rd.m_pDatabase=pdb;<br />
}<br />
Thank you...
|
|
|
|
|
You could, but it may not work.
Take a look at the code for the CRecordset constructor.
You'd need to duplicate the code that the framework does when a database object
is either passed to the CRecordset constructor or created internally in CRecordset::AllocHstmt().
Why not just pass the database object to the recordset constructor?
It doesn't make sense (in the context of the CDatabase/CRecordset classes) to switch databases on a recordset.
Just create a new recordset if the database changes.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Because I used a Global CRecordset object and I can't pass a CDatabase object to it while that CDatabase object is not exist yet!
// Global variables and objects
CDatabase *pdb=NULL;
CRecordsetDerived rd;
<br />
Initialization()<br />
{<br />
pdb->Open(...);<br />
rd.m_pDatabase=pdb;<br />
}<br />
<br />
Function_I()<br />
{<br />
...<br />
}<br />
<br />
Function_II()<br />
{<br />
...<br />
}<br />
|
|
|
|
|
So create the global recordset after you have a database, and recreate it if the database changes.
You can do that with a global pointer instead of a global object.
It still doesn't make sense to do what you're trying to do in the context of the MFC database classes design.
Since recordsets are dependent on a database, it doesn't make sense to create them in reverse order.
That's why there's not a method in the framework to do it
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Can anyone please tell me how to catch all possible exceptions of my C++ Console program (My program doesn't use MFC).
Regards,
Mushq
|
|
|
|
|
With a big try block.
void main()
{
try
{
}
catch(...)
{
}
}
BTW I don't know if it is a good idea.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi,
the big try-catch is great as a fall-back, to exit gracefully with a log;
but it is no substitute for the regular try-catch blocks you should implement at
critical points in the code.
Also it only catches exceptions in the main thread. So there is a lot more to it to get
it right.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Luc Pattyn wrote: which also depends on the .NET version
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
the sentence, while IMO correct if you use .NET, was deleted the minute I posted my reply,
so the reply does not show a "modified..." message. I am surprised you were able to see it anyway.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Luc Pattyn wrote: I am surprised you were able to see it anyway.
It's a multithread issue depending on .NET version I suppose...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|