|
It depends. cout << "Hello"; is one way but it depends. What type of .EXE is it (console or not)? What libraries are used?
Steve
|
|
|
|
|
HI,
I am using console exe.That exe is used for batch processing.
For example,
I run the command like
c:\>.....\abc.exe ordupd
here ordupd is the commandline paramter tat exe accepts
but i coudn't see any messages here eventhought i used getch() and cout statements
The process terminates to
c:\>... after completing the process.\
Thanks,
|
|
|
|
|
Make sure you #include <iostream> . Then you can write out text like this:
std::cout << "Hello";
If the std prefix annoys you there are a number of way to get rid out it. The quick and dirty method if to add a using namespace std to the .CPP file. NOTE: Adding a using directive to a header file will also work but its bad form.
Steve
|
|
|
|
|
Hi,
It's not working . I think its an MFC exe (inside initinstance () if i put cout<< statement , nothing is reflected in dos winndow.Please if you have any suggestions tell me.
Thanks,
|
|
|
|
|
You just want to know how to display the message in the console right (not how to get the command line arguments) ?
Just use cout for that:
int SomeVar = 5;
cout<<"Some Text"<<SomeVar;
|
|
|
|
|
I would write an interface layer (or class) that accepts your message and has a member variable that specifies the destination for the message.
In the old RTL functions, this would mean using fprintf to output the message but you specify the destination with a file structure pointer. Use stdout for the console or open up a file and pass that pointer to send it to a file.
This could be a global object that gets the destination via a call during your app's initialization. The idea is that you specify only one time where your messages go - not in every single instance.
I don't know what corresponding streams methods would be because I never use them.
|
|
|
|
|
hi
I want to look at the source code of CWnd,CButton,CListBox,CException,...... where to find these sources ?
thank you all
i have VS.net 2003
-- modified at 6:52 Tuesday 2nd May, 2006
|
|
|
|
|
CWnd, CButton and CListBox are defined in AfxWin.h .
CException in Afx.h .
|
|
|
|
|
thank you, but it is a header file.
I am looking for the implementation file.
where will be the definitions of functions of above written classes, not declarations.
can you help ?
|
|
|
|
|
an easy way :
create a simple dialog with one button, then put a breakpoint in your onclick handler, debug step by step, and see where it goes...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
I found that names using the popup menu' that appears when RClick on the name of an object -> then you can find where is is declared or defined as you want.
Only a Note:
the class that you list are only an interface between the programmer and the 'build in' code: you can't reach the implementation of the core of a button or a wnd.
|
|
|
|
|
In VC6 it is in MFC\SRC\WINCORE.CPP...
I am not sure about VS.net. But you can try it.
- NS -
|
|
|
|
|
Hi ,
You can find the files in the VC7/atlmfc folder in the application path for .NET2003.
For more information you can just check on the msdn site at the bottom link
http://msdn2.microsoft.com/en-US/library/bs046sh0.aspx
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
Hi all,
In my MDI application, I need to repaint a child window, which has title "Child Window 3", from the application class. How to use FindWindowEx function to get the window handle of the child window? Or is there an alternative?
Kindly suggest me some ideas.
Thanks in advance,
Sarvan AL
|
|
|
|
|
What is the problem with FindWindowEx ?
Elseway, could you create manually a simple loop to find the desired window in the windows list?
Or
UpdateAllView(NULL) probally cold be the more easy solution (but it takes some CPU time)!
|
|
|
|
|
Hi Russell,
FindWindowEx always gives NULL. When I click on New, a new child window opens with titile "MyView1", "MyView2",... When I click this menu item, I want the child windows to be repainted one at a time. Pls have a look at the code:
void CMainFrame::OnUpdateViews()
{
CString strTitle ;
static int nChild = 1 ;
strTitle.Format("MyView%d", nChild) ;
HWND hWnd = ::FindWindowEx(
this->GetSafeHwnd(),
NULL,
"CMyView",
(LPSTR)(LPCTSTR) strTitle) ;
if(::IsWindow(hWnd))
::SendMessage(hWnd, WM_COMMAND, (WPARAM)WM_USER, 0) ;
nChild ++ ;
}
In my WM_USER handler, I simply call "Invalidate()". Instead of repainting all the children, I need to do it for a specific child window.
Hope I have explained my problem clearly.
Sarvan AL
-- modified at 7:55 Tuesday 2nd May, 2006
|
|
|
|
|
Well, ...how to use this routine more times? the variable 'nChild' looks hard to be reset, or not?
About your function: everything looks correct, but:
The CView is child of a frame that is child of the MainFrame, I don't know if it is a problem for FindWindowEx.
Are you sure that strTitle contains the right title? In debug mode you can check the RuntimeClass.
|
|
|
|
|
Hi Russell,
Pls forget abt 'nChild'. As you said, I tried this:
HWND hWnd = ::FindWindowEx(MDIGetActive()->GetSafeHwnd(),
NULL,
"CMyView",
(LPSTR)(LPCTSTR) strTitle) ;
But in vain. What else can solve this problem?
Sarvan AL
|
|
|
|
|
I think that this must work: :->
POSITION ViewPos;
CView* pView;
CString string;
ViewPos=pDoc->GetFirstViewPosition();
while(ViewPos){
pView=(CSWAView*) pDoc->GetNextView(ViewPos);
pView->GetWindowText(string);
if(string==strTitle){
...
}
}
In this way you could refresh more View (if exists) with the same name.
|
|
|
|
|
Hi Russell,
Thanks a lot for your great suggestion.
Sarvan AL
|
|
|
|
|
|
I created a link list using CList class
i add new nodes using using new operator and addtail function
the question is when i remove a node using removeat function will the memory allocated by new operator be freed
if possible give me any exact explanatory links that could satisfy my question
Deepchand P
Software Developer
Optiwise Solutions
|
|
|
|
|
Deepchand P wrote: the question is when i remove a node using removeat function will the memory allocated by new operator be freed
No it will not. It will remove the object from the list, but will not free the memory it pointed to. That is your responsibility. You can check this in the CList source code if you want.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
How could i block certain area with a rectangle out of 400*400 pixels in a bitmap
|
|
|
|
|
Do you need to segment from one bitmap? if yes I suggest use BitBlt
|
|
|
|