|
|
Sorry about the delay in the response, but I didn't receive an e-mail notification of your reply. What I'd like to know is a way to profile C++ code using VS 2005.. Can't find a nice tutorial =)
Best regards
Fratelli
|
|
|
|
|
How to connect sql server using ODBC in a MFC application?
Sql server is on the another computer in the same LAN.
|
|
|
|
|
|
Hi, thank you for helping me!
I have visited the website.
The string "Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;" is useful.
I tried , I got it
thank you ...
|
|
|
|
|
|
|
Hello,
I am working with Visual C++ 6.0
I know how to spawn an external program from my c++ app.
What I am trying to figure out how to do is this:
1. MyApp calls testprog.exe
2. testprog.exe does it's thing while MyApp waits
3. when testprog.exe is FINISHED, it will return a value
4. MyApp should then do something useful based on that value
So, in a nutshell, my program needs to call an external program (which I can do), wait for it to finish, and then do something useful with the value returned by the spawned program. I am having trouble figuring out exactly HOW I can get the spwaned program's ACTUAL return value (not the value returned because the program was started successfully.
Trying to clarify more:
1. Start MyApp
2. MyApp calls TestProg
3. TestProg is finished
4. Return value from TestProg is (DWORD)0xe0018d06
5. *PROBLEM HERE* MyApp needs to retrieve (DWORD)0xe0018d06 that was returned by TestProg, then resume execution and perform actions based on whether TestProg returned (DWORD)0xe0018d06 or 0x00000000
Any help would be IMMENSELY appreciated!
Thanks in advance!
-Steve
|
|
|
|
|
You may use CreateProcess to start TestProg and then WaitForSingleObject on TestProg handle.
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
[My articles]
|
|
|
|
|
Sir,
Return value of WaitForSingleObject can be one of the following-
WAIT_ABANDONED, WAIT_OBJECT_0, WAIT_TIMEOUT, or WAIT_FAILED. How to get application returned value ?
|
|
|
|
|
You may call GetExitCodeProcess whenever WaitForSingleObject returns WAIT_OBJECT_0 .
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
[My articles]
|
|
|
|
|
|
I am using following code to send message to remote machine through sockets, I am calling mentioned code when a button of MFC dialog based app is clicked and it is working fine. But I don't know how to receive messages from remote machine through sockets.
Can anyone please guide me how to receive messages in dialog based application through socket?
WSADATA w;
SOCKADDR_IN target;
<br />
int error = WSAStartup (0x0202, &w);
<br />
if (error)<br />
return 0;<br />
<br />
m_sckt = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (m_sckt == INVALID_SOCKET)<br />
{<br />
return 0;<br />
}<br />
<br />
target.sin_family = AF_INET;
target.sin_port = htons (PortNo);
target.sin_addr.s_addr = hostname;
if (connect(m_sckt, (SOCKADDR *)&target, sizeof(target)) == SOCKET_ERROR)
{
return 0;<br />
}<br />
send(m_sckt, "Test", 5, 0);
Thanks,
Mushq
|
|
|
|
|
Hi all.
I am Comparing two strings.....when both are in English...Its Comparing Fine..
But if One string is in Japenese...Its giving runtime error..
Ex..
I am Comparing ("INBOX",bstrFolder)......
when bstrFolder is in English Letter i.e INBOX....It Compares Fine..
But when it is in Japenese Letter its not Comparing..
I hope you got me...
Thank you
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Please post the code.
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
[My articles]
|
|
|
|
|
bstrSourceQuery = _T("select "
" \"DAV:href\""
" from scope ('shallow traversal of \""
+ bstrSourceFolderUrl+_T("inbox")+ "\"') "
" WHERE \"DAV:isfolder\" = false AND \"DAV:ishidden\" = false"
" ORDER BY \"urn:schemas:httpmail:datereceived\" DESC");
AfxMessageBox(bstrSourceQuery);
m_pUserConnection->Provider = _T("msdaipp.dso");
m_pUserConnection->Open((_bstr_t)strFolderURL, bs_UserName,bs_UserPwd, 0);
bstrSourceFolderUrl += _T("inbox");
m_pUserRecord->Open((_variant_t)bstrSourceFolderUrl, m_pUserConnection->ConnectionString,
adModeRead, adFailIfNotExists, adOpenSource, bs_UserName,bs_UserPwd );
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
I see no string comparison in your code.
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
[My articles]
|
|
|
|
|
See Actually I am Reading the mails from Inbox.....If the mailbox is in Japenese its not reading ...I am not Comaparing it...If it is Inbox it opens
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
|
Hi,
I am having an application where we mainly do analysis on images being grabbed in real-time. The current version basically works in the following way- Loop[^]
the critical section code within writing into shared buffer looks as follows
CCriticalSection CritSect;<br />
CritSect.Lock();<br />
memcpy(SharedBuffer, cap_buffer, FrameSize);<br />
Timestamp_FrameWrite = LoopStart->GetTimeDiff();
CritSect.Unlock();
and the code within reading frame is as follows
CCriticalSection CritSect;<br />
CritSect.Lock();<br />
memcpy(proc_buffer, SharedBuffer, FrameSize);<br />
Timestamp_FrameRead = LoopStart->GetTimeDiff();
CritSect.Unlock();
From the block diagram you will notice that camera thread will call the function to write the newly captured frame into shared buffer for every 20ms (since the exposure time is 20ms) and this is also verified by finding the difference between two successive "frame write" timestamps (~18ms to ~22ms). This is all fine.
Now when I find the difference between two successive "frame read" timestamps, it always gives me either ~15ms or ~31ms as shown below
15.8758<br />
15.6622<br />
31.008<br />
15.845<br />
15.605<br />
31.062<br />
15.819<br />
15.663<br />
15.748
but when you average these over total number of frames read, it give ~20ms which shows that it is not dropping frames while reading (in other words its analyzing all frames being captured). So, the question is why is the "frame read" timestamp doesnt correspond to frame rate (i.e ~20ms or ~49Hz), this is the same case even when I am not doing any analysis (which hardly takes more than 10msec)?? I have to say that the loop function runs on a TIMER which has 5msec timeout value.
-thanks
PKNT
|
|
|
|
|
Can you share more about how do you measure time difference two frames?
-Saurabh
|
|
|
|
|
the time between two successive frames is just a simple subtraction between two successive TimeStamp_FrameWrite s. Same applies with TimeStamp_FrameRead s. For example, lets say the LoopStart when we start the loop is 0ms then the TimeStamp_FrameWrite is always ~20ms, ~40ms,~60ms etc, which is same as camera exposure time. The TimeStamp_FrameRead should also be multiples of ~20ms , but its always either ~15ms or ~30ms as I mentioned earlier. Hope I am clear now.
PKNT
|
|
|
|
|
What is the source of these timestamps?
Aside from the high-resolution performance counter, there's no timers available on
Windows with a resolution better than ~15ms.
Also, your critical sections are useless as shown. A critical section will only
work if threads lock on the SAME critical section object. If your frame read and write
code shown is executed on separate threads, you effectively have NO syncronization.
Mark
|
|
|
|
|
The source of timestamps is a small custom defined class with calls to QueryPerformanceCounter/frequency. Yes, those critical sections have no real use as far as I tested and we dont use in our application. Actually another lab took our code and modified it for their application and their programmer left without actually resolving these issues and they want me to check it. The timing is pretty much accurate for 'frame write' around ~20ms, its the 'frame read' that are not what we expect.
PKNT
|
|
|
|
|
Interesting.
The timestamps look like something somewhere is relying on a low-res timer...
suspiciously with an accuracy very close to the tickcount in Windows
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|