|
Thanks Dear,
I am developing my application only for Windows2000 (no Win9x systems)
So I there any simpler way out for my doubt ??
Thanks a lot.
Regards,
Rohit Dhamija
|
|
|
|
|
Hi Rohit,
For Windows 2000 just add the following function to your code and call it at the start of your application.
void ShowConsoleWindow(bool bHide )
{
ShowWindow(GetConsoleWindow(), (bHide) ? SW_SHOW : SW_HIDE);
}
Then to hide the console window, call:
<code>
ShowConsoleWindow(true);
and to show it again (if necessary):
<code>
ShowConsoleWindow(false);
best wishes,
Dark Angel
|
|
|
|
|
Hello,
in my application I use the activex component msflxgrd.ocx. I use it in a dialog and in a view. At a PC without visual c++ installed I only can see the component in the dialog not in the view. I copy the component in C:\Winnt\system32, and I register it.
Do I need some dll or library?
Thank you.
|
|
|
|
|
Hi,
I need to simulate the process OS detecting the device when is it connected to system thru USB port and loads a driver. OS should treat my application as a device and load its driver..plz any one help me out this .
|
|
|
|
|
hi ,
i have the following problems... would be gratefulif you could kindly give me some suggestions.....
1)i have a dialog based application in which i have to implement a scroll view .. can i use CSrollView(i suppose i cant)..if not how do i do it..if yes then how do i do it
2)i have to capture the entire image irrespective of being within the viewable region or not ....how do i go about it....
plesae help...
Thanking you.
Satadru
|
|
|
|
|
1) to use Views in a Dialog there is a splended article in MSDN with sample code that should help
( but i can't figure out why you have to use CScrollView it doesn't provide anything else other than scrolling support
you can use scroll bars on the dialog instead)
2)if that image is not completely displayed than you cannot capture it (it would be like , you give the application ur DC and ask it to paint on it )
but you can try to get that window's DC and Bitblt (might work)
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
hi ,
thanks for the help cud u please tell me which article is that.... i have another problem..
from my main dialog iam creating another dialog and popping it....from this second dialog i have to access members of the main dlg ... how do i go about it ... i have tried DYNAMIC_DOWNCAST but it isnt working in my compiler ... any way ouy...
Thanking you.
Satadru
|
|
|
|
|
class CAnotherDlg .....
{
CDialog *m_pPrevDlg;
}
CFirstDialog :: OnInitDialog()
{
CAnotherDialog dlg;
dlg.m_pPrevDlg = this;
dlg.DoModal();
}
now whenever you use the m_pPrevDlg just cast it and use it
((CFirstDialog*)m_pPrevDlg)->FireAway();
(Don;t forget to include the firstdialog.h )
as for not finding the article it is by Paul dilascia and it show how to use CHTMLView in a dialog
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Hello guys,
I am still having trouble to catch "Enter" (Return) key press from a PC keyobard in my app. I think the problem mainly comes from the fact that the app has a parent dialog with serveral embedded child dialogs (only one child dialog is shown at a time on the app window, different child dialog is shown using ShowWindow(SW_SHOW), ShowWindow(SW_HIDE).
Preferrably, I want the child dialogs to catch the "Enter" key press. So what I did, was first, "return 0" in the parent class' OnInitDialog() and set the focus to the appearing child's DDX control, say a CButton, in the child class' OnShowWindow().
With the above method, I can get the focus set (using SetFocus()) to each desired CButton in the child dialogs and I can cycle through the buttons (if there are multiple) in each shown child dialog using arrow keys. However, none of the buttons will not respond to "Enter" key, but only "Spacebar" key to perform OnBnClicked() function. If I "tab" to the button that belong to the parent dialog, pressing the "Enter" key will call the OnBnCliked(). Can anyone explain why?
Also, I tried to see if the Enter key is caught in the child class by overriding its OnOk() or OnKeyDown() but the key pressed doesn't seem to go through them either.
|
|
|
|
|
i don't understand you! but i think this may be help you:
BOOL CMyCTIDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message==WM_KEYDOWN)
if(pMsg->wParam==VK_ESCAPE||pMsg->wParam==VK_RETURN)
return true;
return CDialog::PreTranslateMessage(pMsg);
}
|
|
|
|
|
Thanks alot for the reply, taiozi.
And apologies for the badly phrased post, I wrote that in a rush. I have rewritten it. Would appreciate if you could give it one more read and see if you can understand it now
However, the PreTranslateMessage() you mention here might be what I am looking for, I will try that in my child dialogs' classes. Will report back.
Thanks again
|
|
|
|
|
Thanks tiaozi,
with your help (the code), I can correctly catch the Enter key press(VK_RETURN) and tell if it's caught by the parent dialog or the embedded child chialog. Now I realise when the app was initially load, the key press is always caught by the parent, although a button in the child dialog has been highlighted (here I'd think so the focus is set to the child dialog?).
Do you know how I can correctly set the focus to child dialog when the app is loaded? I've tried two different ways, none of them seem to work.
One is to place pChildDlg->SetFocus() in the parent class' OnInitDialog(). pChildDlg is the pointer to the child dialog that is showing.
Two is to place SetFocus() in the child class' OnShowWindow(), whether to the child itself (thus this->SetFocus(); ) or a control (in my case, to a CButton). Here as I mentioned earlier, when I SetFocus() to the CButton, I can see the button is highlighted as the app window is initially loaded. But when I hit "Enter" key, this input message is still caught by the parent?
|
|
|
|
|
OK, I got it working, with the second method (after some fix). I forgot to put ON_WM_SHOWWINDOW() message map in.
|
|
|
|
|
I know that TextOut method helps displays strings...what if i want to display integer/float? Do I have to convert it to string n use TextOut? Or is there another available method?
Thank you
|
|
|
|
|
i'm not sure if TextOut directely accepts integers, but you can use the 'Format' method of CString to construct a string from an integer (or float, double etc.). Hope this helps.
Er zit een korstje op mijn aars.
|
|
|
|
|
Thanks for d reply...just to confirm. So, there is no other method to display integers than to convert it to string. Is it?
Thanks again.
|
|
|
|
|
char buff[25];
sprintfbuff,"%d",m_yourInteger);
pdc->TextOut(buff);
hope this works for you, if you need some other stuff, do let me know.
regards
balkrishna talele
|
|
|
|
|
BOOL TextOutF(HDC hDC, int x, int y, LPCTSTR szFmt, ...)
{
TCHAR szOutput[512];
va_list args;
va_start(args, szFmt);
_vsntprintf(szOutput, 512, szFmt, args);
va_end(args);
return TextOut(hDC, x, y, szOutput, _tcslen(szOutput));
}
Now you can write:
int nMyInt = 34;
TextOutF(hDC, 0, 0, "my int = %d", nMyInt);
Output:
"my int = 34"
|
|
|
|
|
No, You have to convert it to a string and then print it. You can use CString Format method or wsprintf or sprintf and create the formatted string then use it to display the msg.
|
|
|
|
|
Hello Sir...
Sir..My requirment is to insert first page in Tiff which is created by user in CScrollView...
Please Suggest me any solution How can I do...
I'm using LibTiff...
As your've also used Libtiff in your project..this means u can better Suggest me...
I'm Very thankful to u if u provide me short function which convert SrollView to Image & place in Tiff as first Page...
Also I Suggest me How can I modify Tiff file...e.g: I want to change or Insert Text in Particular position In First Page of Tiff...
Please Guide me Sir..I'm trying to solve this problem from One week...
I hope U will help me...& I hope u will spare some time from your busy life & Reply me.....I'm waiting reply from U..
So Nice of U..that U listen my problem..& thinking its solution...
Thanks...Sumit
sumit_delhi
|
|
|
|
|
Hi, I hope that this doesn't sound stupid...
I'm currently in first year University... and I'm planning on becoming a software engineer. I picked up Visual Studio.net 2003, and so far I'm doing pretty good... except for one thing. Does anyone know how to statically link visual C++/C# programs when compiling, so that I can distribute the programs that I made to friends who do NOT have Visual Studio.net, or any other programming language for that matter?
Any help would be greatly appreciated.
Thank you.
Mike
|
|
|
|
|
When you disturbute ur binary you also need to disturbute the files that ur application depends upon, like support dlls n suff. you can find out on what all dll that ur app is depending upon by using either dumpbin or depends.exe
One way is to make a installer for you app... its not that difficult for a simple application, or provide all the dlls to your friend and put them in their necessary places.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
For C++ projects, in the properties for the project, go to General. If using MFC, change "Use of MFC" to "Use MFC in a Static Library". For all C++ projects, go to the C/C++|Code Generation and change "Runtime Library" to a non-DLL option.
For C#, your users will need to download or somehow install the .NET runtime package. (It's 20MB, so they'll need a fast connetion if they download it.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
hi..i have a project, designing a pci driver using C++..where should i start?can some one give me an idea?which C++ is suitable for designing pci driver?...can someone help me? i really appreciate it a lot..
|
|
|
|
|
I assume you are working on windows and not linux.
nmelah wrote:
which C++ is suitable for designing pci driver
MS Visual C++ 5.0 or greater.
nmelah wrote:
where should i start?
Obtain the microsoft DDK.
John
|
|
|
|