|
What do you mean exactly by start ? If you put the loop, your program will never end (well, that seems to be obvious). I don't really understand your question.
|
|
|
|
|
vctrlao wrote: as the program below,when I click the .exe file it starts very slow,but if I delete the endless loop it can start very quick,why??
How can you see that?
What's the purpose of the experiment (just curiosity)?
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]
|
|
|
|
|
|
No, not on a windows platform. Anyway, even having a resolution of 1msec is not possible because windows is not a real time operating system.
|
|
|
|
|
And see Timers in MFC / C++[^]and Timers Tutorial[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
My application is MDI.but we modified the precreatewindow and using as single window applicaiton.
And we transfer to different window using menu or pageup,page down.
For ex,i have 5 pages of graphics window showing some animation and index of all five pages as index window.By clciking the topics in index,the new window will appear and we destroy the prevoius window.I draw the window details in OnDraw().
But now i want some graphics window appear as popup with close button.So i set flag for tht particular window and i set setwindowpos()...But its now flcikering...
I dnt know wat to do...
Code:
Same window:
---------------
///Clciking function in Index page
{
.
.
.
.
if( gpGView->glg_animation[giSchPNo].m_hWnd )
{
gpGView->glg_animation[giSchPNo].DestroyWindow();
giSchPNo = iPanNo - FirstGraph();// - 1;
giSchPNo = giGraphicCnt;
return;
}
Then it goes to Ondraw() and draw the window.
As Popup:
----------
///Clciking function in Index page
if(help==1) ////shown as popup
{
if( gpGView->glg_animation[giSchPNo].m_hWnd )
{
////gpGView->glg_animation[giSchPNo].DestroyWindow();
giSchPNo = iPanNo - FirstGraph();// - 1;
giSchPNo = giGraphicCnt;
return;
}
}
in Ondraw() i add this line
((CGraphView *)(((CMainFrame *)AfxGetMainWnd())->pDisplayedViews[6]))->glg_animation[giSchPNo].SetWindowPos(HWND_TOP,(GetSystemMetrics(SM_CXSCREEN)/2) - (480/2),(GetSystemMetrics(SM_CYSCREEN)/2) - (350/2),505,280,SWP_SHOWWINDOW);
Anu
|
|
|
|
|
I have developed dialog based application to capture data from a device on RS232 & display those data in VC++ 6.0 frontend. Now i need to print this data in defined format on the printer. May be i need to select the printer & then print the report.This methode would be better as the printer to be used is not finalized yet with this application. I am new to VC++, I am not sure which method would be better to use in VC++.
Could you guide how to proceed about his requirement.
|
|
|
|
|
If you're using MFC then you may take advantage of this class [^], also have a look at its inspiring article [^].
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]
|
|
|
|
|
which class would i use to implement multithreading...could you send me some literature & sample code to achieve this...
|
|
|
|
|
diptipanchal wrote: which class would i use to implement multithreading
Is this related to your previous question?
Anyway have a look at this page [^]. Be warned, multithreading is a rather complex topic.
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]
|
|
|
|
|
thanks Pallini...I could print the data displayed on the frontend...& customized the printout....Really thanks a lot...
|
|
|
|
|
See Printing a Document (Windows)[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I could print the data displayed on the frontend...& customized the printout. But when the print command is clicked, it displays as below:
Set Font Arial Size = 8
My name is George Papaioannou _________________________________________________________________
Set Font Arial Size = 9
My name is George Papaioannou
....
and so on...
I want to print the data without line feed. that means printout as below.
Set Font Arial Size = 8 My name is George Papaioannou _________________________________________________________________
Set Font Arial Size = 9 My name is George Papaioannou
i don't know where line feed is given in the print?
snippet:
prt.Print(hFont,"Set Font Arial Size = 8",FORMAT_NORMAL);
prt.Print(hFont,"My name is George Papaioannou",FORMAT_NORMAL);
prt.Line (PS_SOLID);
prt.Print(hFont1,"Set Font Arial Size = 9",FORMAT_NORMAL);
prt.Print(hFont1,"My name is George Papaioannou",FORMAT_NORMAL);
prt.Line (PS_SOLID);
I would need to print the data on the same line as actually i want to print text & variable defined in the frontend.
If its only a text there is no problem But i want to print text & variable together which i am not able to print on the same line.
Pl help.....
|
|
|
|
|
Hi ,
Can anybody help me out as i have an application that is developed using multibyte character set now i have to convert it to Unicode so as the application can provide support to multiple languages.
Thanks
Varun Bhatt
|
|
|
|
|
If you made sure that you always used TCHAR instead of char then things should not be too difficult. Otherwise, well, you have to replace everything by TCHAR strings. Anyway, this article[^] is very good to get started.
|
|
|
|
|
That was a great help and interesting article.
Thanks !!!!!!!!!!
Varun Bhatt
|
|
|
|
|
Hai!
I have image data present in an Byte array, the image can be a bitmap, jpg or jp2 image. Now how to paint this byte array on my dialog box as an image?
Thanks!
|
|
|
|
|
First you have to construct the image from the byte array. You can use CxImage[^].
Try the method:
bool CxImage::Decode(BYTE * buffer, DWORD size, DWORD imagetype)
You can see the demo application from the link. I think that it will help you.
Nuri
|
|
|
|
|
kapardhi wrote: I have image data present in an Byte array, the image can be a bitmap, jpg or jp2 image. Now how to paint this byte array on my dialog box as an image?
I don't know if posting and reposting again and again will actually do the job...
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]
|
|
|
|
|
My application is developed on Multibyte Character Set.Now I want to support UNICODE character set. How can I do it?
Is there any direct way to convert it to support UNICODE character set?
|
|
|
|
|
Are you the same guy as Varun Bhatt ? Anyway, have a look at this thread[^]
|
|
|
|
|
no, Not at all. Why do you think so?
Anyways,thanks for your help.
|
|
|
|
|
Hi,
i am using the function SetWindowsHookEx() to set the keyboard hook. The code snippet is as follows
if(myHook == NULL)
myHook = SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)myFunction, AfxGetApp()->m_hInstance, NULL);
LRESULT myFunction( int ncode, WPARAM wparam, LPARAM lparam)
{
if((wparam == VK_F10))
{
DoSomething();
}
return ( CallNextHookEx(myHook,ncode,wparam,lparam) );
}
The problem is that the function myFunction() is getting called two times.
Can someone tell me how can i avoid this.
Thanks
|
|
|
|
|
ashtwin wrote:
The problem is that the function myFunction() is getting called two times.
This is normal behavior. When you press a key on your keyboard it generates a keypress and release and if you hold the key down it generates repeat keys. You should probably have a look at how the the KeyboardProc [^]hook procedure is implemented. And if you read About Keyboard Input[^] you will find that you can check the transition state of the key with something like:
if (HIWORD(lparam) & KF_UP)
{
}
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks is is working after checking the condition
if((wparam == VK_F10) && (lparam < 0))
{
DoSomething();
}
|
|
|
|