|
Max++ wrote: char ch[64]
strcpy(ch,str);
How about:
TCHAR ch[64];
_tcscpy_s(ch, str.GetLength(), str);
"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
|
|
|
|
|
|
hi,
before I install the visual studio 2005, I use the vc 6.0 to debug, when I run the program, if finally there are some bug, the visual 6.0 will jump to the line that has bugs, but after i installed the vc 2005, for the same program(I run it in vc 6.0), if I run it, then the vc tells me I have not start the just-in-time debugger, but I can not find out where to set just-in-time debugger,
any ideas?
|
|
|
|
|
I had the Same Problem. Struggled with it for months, reinstalled VC6, No Avail. Ended up re-installing XP as a new installation. i.e. Scrap the entire Drive. re-installed VC, that solved it.
Bram van Kampen
|
|
|
|
|
Hi , sorry for a new thread. I needed to open it since I made some progress.
By the way , I implemented my callback function without buffering as below. So can you check it ?
Especially I am not sure about getting floats from BYTEs and , replacing new floats back after making some signal processing.
STDMETHODIMP BufferCB( double SampleTime, BYTE * pBuffer, long BufferSize )
{
unsigned int i,j ;
short nCurrentSampleValue = 0 ,temp = 0;
float fCurrentSampleValue = 0,fNewSampleValue =0 ;
long nSampleCount ;
short nRatioOfDataTypes ;
nRatioOfDataTypes = sizeof(short)/sizeof(BYTE) ;
nSampleCount = BufferSize / nRatioOfDataTypes;
for(i=0;i<nSampleCount;i++)
{
nCurrentSampleValue = 0 ;
fCurrentSampleValue = 0 ;
for(j=0;j<nRatioOfDataTypes ;j++)
{
temp = 0x0000 ;
temp = ((short)pBuffer[i*nRatioOfDataTypes+j]) ;
temp = temp << (8*(nRatioOfDataTypes-j-1)) ;
nCurrentSampleValue |= temp ;
fCurrentSampleValue = ((float)nCurrentSampleValue) / 32768 ;
}
fNewSampleValue = MAKE_SOME_SIGNAL_PROCESS(fCurrentSampleValue);
////////////////////////////////////////////
temp = (short) (fNewSampleValue*32768);
pBuffer[i*nRatioOfDataTypes] = (BYTE) (temp & 0xFF00) ;
pBuffer[i*nRatioOfDataTypes+1] = (BYTE) (temp & 0x00FF) ;
////////////////////////////////////////////
}
}
Finally can you send me any sample code for buffering or make any suggestion about that ?
Thank you very much...
Best Regards
|
|
|
|
|
Hello everyone,
Just want to confirm whether my understanding is correct.
The statement in source file,
#pragma comment(lib, "DLL1.lib")
has the same effect (as an alternative approach) of set DLL1.lib as implicit link library input in project link settings? So, we choose either one method to configure implicit linking input library?
thanks in advance,
George
|
|
|
|
|
Yes both methods have the same effect on the generated PE image. There is no difference. It should be noted that this particular pragma is not standard and Microsoft specific.
Best Wishes,
-David Delaune
|
|
|
|
|
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 />
|
|
|
|