|
sriram65 wrote: I want a pointer to the application object........Please help me
You can get process id of a window's parent process by calling GetWindowThreadProcessId . Hope this is what you meant by Application object!
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Thanks for replying.I am a beginner when it comes to processes and threads
Can you explain in simple terms what processes and threads are?
And by application object I meant getting a handle or a pointer to a object of CWinApp class
Thank You
|
|
|
|
|
How to create a dll in vc++ and use it in other project?
kavita srivastava
|
|
|
|
|
Don't post two different question with the same title (use meaningful titles).
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
|
|
|
|
|
Not duplicate this thread is for dll and othe thread is for make a simple project with vc++.
|
|
|
|
|
Fixed.
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
|
|
|
|
|
|
How to create simple vc++ project?
kavita srivastava
|
|
|
|
|
Run Visual Studio (assuming you have VS2003 or later), select File->New->Project menu item, then choose Visual C++->Win32 node and select Win32 Console Application in the Templates frame.
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
|
|
|
|
|
Do you want to make console program or windows program?
|
|
|
|
|
|
There are no spoons simple VC++ projects.
"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
|
|
|
|
|
|
I am working on UNICODE Built-MFC Application that have to display both
Thai and Japanese texts on dialog.
The ploblem is My application's dialog can only display the language that I set as
default language for non UNICODE program in Regional and setting.
e.g.
If I set language for non UNICODE program to thai , my dialog
will only display thai language correctly but the japanese text will be displayed as
?????.
But when I try to set control's caption using SetWindowText function,It work for
both thai and japanese language.
Are there any specific setting that I have to take care in order to make my dialog support both
language in resource edit mode ?
|
|
|
|
|
A suggestion: Use CWnd::SetFont () on the specific controls (like CStatic, CEdit) to set the Japanese controls to a Japanese font, and the Thai controls to a Thai font.
|
|
|
|
|
Then how can I create a control that have to display both thai and japanese ?
and having to call SetFont to every control on dialog seem to be a little to much work.
since I expect Visual studio to let me edit Control caption in dialog on the fly(in any language).
Please give me some advice.
Thank in advance
|
|
|
|
|
You could create two copies of the dialog; one for each language.
Another option: you can set the font in a loop that iterates through all the dialog's controls. This link: http://www.themssforum.com/MFC/iterate-controls/[^] tells how to do this.
I suggest you pre-create both fonts because creating a new font every time you do SetFont is slow.
|
|
|
|
|
Hi all,
I m working on VC++2005 ,MFC, SDI-Type Application.
When i m create my project i was no need of Print function so i was deleted Print("Print,Print Preview and Page Setup") Menu item from the Main menu.
But now i want to use them ,I m add all these in Menu. But it is not working.
Please tell me how can i use them.
I m waiting for ue Valuable suggestion.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Make a new project with the wizard and look in the rc-File to copy the needed data...
But to get fine results, as mentioned "you got to do your homeworks" and implement the event handlers & functions yourself.
Greetings from Germany
|
|
|
|
|
hi.. i have a string of format "name tom". how can i get out tom out of it.
regards
amit
|
|
|
|
|
You may search for the ' ' token, for instance (plain C )
char string[] = "name tom";
char * p;
p = strtok(string, " ");
p = strtok(NULL, " ");
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
|
|
|
|
|
What is the type of your string ? std::string, CString (MFC) or a plain char* (or TCHAR* or wchar*) ?
For the last one, take a look at strtok[^] (and choose the correct version depending on your UNICODE settings).
|
|
|
|
|
Thanks for reply.. it works
Regards
amit
|
|
|
|
|
If you are using of MFC you can use of CString::Mid or CString::Find and then CString::Right.
|
|
|
|
|
Hi,
How to display icon or bitmap at Menuitem???
I already tested codes below, but it's not working???
I got assertion failure error...
I need help???
private:
CBitmap m_bmpMenuFileNew; //File new bitmap (Checked and unchecked)
CBitmap m_bmpMenuFileOpen; //File open bitmap (Checked and unchecked)
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
//Load the bitmap resource
ASSERT( m_bmpMenuFileNew.LoadBitmap( IDB_MENU_NEW ) );
ASSERT( m_bmpMenuFileOpen.LoadBitmap( IDB_MENU_OPEN ) );
//Access the application menu
CMenu* pMenu = GetMenu();
ASSERT( pMenu );
//Assign the icon
ASSERT( pMenu->SetMenuItemBitmaps( ID_FILE_NEW, MF_BYCOMMAND,
&m_bmpMenuFileNew, &m_bmpMenuFileNew ) );
ASSERT( pMenu->SetMenuItemBitmaps( ID_FILE_OPEN, MF_BYCOMMAND,
&m_bmpMenuFileOpen, &m_bmpMenuFileOpen ) );
return 0;
}
CMainFrame::~CMainFrame()
{
if( m_bmpMenuFileNew.m_hObject )
m_bmpMenuFileNew.DeleteObject();
if( m_bmpMenuFileOpen.m_hObject )
m_bmpMenuFileOpen.DeleteObject();
}
|
|
|
|