|
In the global.h you have
extern D2N_GLBL_STRUCT *D2N_GLBL;
Did you put
D2N_GLBL_STRUCT *D2N_GLBL; in one of the .cpp file?? if you dont do it, it will give you linker error.
P.R.A.K.A.S.H
|
|
|
|
|
Hello!
I would like to know that how can I call up the Standard Windows print dialog using vc++ (non MFC) ?
And, at the same time, a file (i.e. a MS Word doc.) is sent to this print dialog for printing.
Thanks a lot for answering my question !! =^^=
|
|
|
|
|
How to get the size of CScrollView's scrollbar?
|
|
|
|
|
Use GetSystemMetrics() with either:
SM_CXHSCROLL,
SM_CYHSCROLL Width, in pixels, of the arrow bitmap on a horizontal scroll bar; and height, in pixels, of a horizontal scroll bar.
SM_CXVSCROLL,
SM_CYVSCROLL Width, in pixels, of a vertical scroll bar; and height, in pixels, of the arrow bitmap on a vertical scroll bar.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
i m new to MFC
how can i create Toolber in Dialogbased.
plz send me code
thanx
|
|
|
|
|
Create a member variable of CToolBar,
Create the toolbar with the dialog window as the parent window.
You can create a toolbar resource and load the toolbar using LoadToolBar method.
I am not sure about this but i guess this should work.
P.R.A.K.A.S.H
|
|
|
|
|
|
Hello,
I would like to use VB activeX SSTab control 6.0 SP5 in VC++.
So I add this activeX to my project (Dialog Application), I add one of this tabbed dialog in my dialog to do a kind of property sheet.
Ok, it is very easy to create a property sheet with x tabs, choose the style, the color, etc etc ...
But :
1) Why can't I see clearly the control in my dialog when I create it? I just can see the border but I can see it when I launch the app or have a preview of the dialog in the ressource editor ...
2) when we read MSDN, it is easy to add controls in the tabs by just selecting the tabs and add control in it ... when I do it, controls doesn't "belong" to the tabs, they are just over it and desappear as soon as I click on another tab ... what's wrong with this ?
3) how do I 'link' my SSTab pages with the controls or with the other doughter dialogs, as I do with property sheet ?
4) How do I set the values in these pages? How do I retrieve the input values, the clicks done on various controls, etc etc ??
I do not find any doc describing how I should do this
Any infos appreciated
Thanks in advance
DD
|
|
|
|
|
Can somebody tell me how I can tell CHTMLView to navigate to an Resource ?
|
|
|
|
|
|
Yeah. THX. Sorry but i think i wasn't too preciously. I wanted to know how I can tell the class (CHTMLView) to navigate to an resource and not to an url.
SRY.
MFG
RedDragon
|
|
|
|
|
You could use Paul DiLascia's CHtmlCtrl (which is really a CHtmlView ) to do this. See this[^] article for detailed instructions.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
How do I get minor errors in OLE DB Provider. Like if I get E_FAIL, how wd I get the minor error associated with it?
|
|
|
|
|
I belive E_FAIL is total failure of the operation without specific reason.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
no, E_FAIL does give minor error info. Every OLE DB Error gives the minor error info as well. I don't know the way to get this error. Documentation is too vague to understand.
|
|
|
|
|
Could someone tell me how to get a file's date time stamp? I am using VC++ 2002. Is there a way to get this using streams? or do I have to use MFC?
Thanks in advance
|
|
|
|
|
ByNar wrote:
Could someone tell me how to get a file's date time stamp?
GetFileTime() comes to mind.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi,
I have a virtual nic adapter that I need to recognize in run time to find the ip it has.
For windows XP the function "GetAdaptersInfo" does the trick and returns the right name in the Description field of the IP_ADAPTER_INFO structure.
For window 2000 "GetAdaptersInfo" returns a different Description field in the IP_ADAPTER_INFO structure( it returns "virtual adapter").
For windows NT the function "GetAdaptersInfo" is not supported at all.
Is there any way to find out all the existing adapters and their information in windows NT?
Is there any way to get the "friendly name" of the adapter from the windows api?(that is the name that is returned by ipconfig /all).
Please help.
Thanks.
avivhal
|
|
|
|
|
There are applications of Microsoft on which text is present like WordPad, notepad, explorer e.t.c.
Suppose if i have a window of WordPad opened. Some text is written in the client area of this window. Now i want my application to "grab" all the text written in the client area of this window of WordPad. Is it possible?? If yes, then can you suggest me some method ???
|
|
|
|
|
With Wordpad or Notepad, not that I know of. You can, however, do what you require with Word. Search MSDN for Word (or Office) Automation.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hello
I need working example of a Modeless Dialog in DLL using MFC and LoadLibrary.
(in this code fragment I left out error checking.)
What I have done is
in MainEXEView.cpp
void CMainEXEView::OnButton1()
{
HandleToDLL= LoadLibrary("modelessDLL.dll");
InterfaceDLLPointer = (DLLInterfaceMethod) (GetProcAddress(HandleToDLL,"CreateMyDlg"));
TheHwnd = GetDlgItem(IDC_HOLDDLL)->m_hWnd;
InterfaceDLLPointer(TheHwnd);}
}
in the DLL.cpp ( statically linked DLL)
dlldlg *dlg;
__declspec (dllexport) __stdcall CreateMyDlg(HWND pParentWnd)
{
CRect rc;
AFX_MANAGE_STATE(AfxGetStaticModuleState()); // Need this to switch to local module state.
CWnd * Parent = CWnd::FromHandle(pParentWnd);
dlg = new dlldlg();
dlg->Create(dlldlg::IDD, Parent);
dlg->ShowWindow(SW_SHOWNORMAL);
Parent ->GetWindowRect(rc);
Parent ->ScreenToClient(&rc);
dlg->MoveWindow(rc);
return dlg->m_hWnd;
}
The dlldlg has some buttons for testing.
At this point, the DLL dialog appears correctly on the screen. The problem is not that the keyboard events fail, as reported elsewhere.
Rather, the buttons do not work and the program hangs. So....
I did the following:
BOOL CMainEXEView::PreTranslateMessage(MSG* pMsg)
{
BOOL AnyMessages;
AnyMessages=CFormView::PreTranslateMessage(pMsg);
if (!AnyMessages)
{
if (Ready)
{
if (InterfaceDLLPointer_Messages!=NULL)
AnyMessages= InterfaceDLLPointer_Messages(pMsg);
}
}
return AnyMessages;
}
where InterfaceDLLPointer_Messages was another entry point into the DLL, called HandleMessages
DLL.cpp
__declspec (dllexport) BOOL __stdcall HandleMessages(MSG *pMsg)
{
// return theApp.PreTranslateMessage( pMsg); // this did not help
// return dlg->PreTranslateMessage( pMsg); // this crashes
AFX_MANAGE_STATE(AfxGetStaticModuleState());
TRY
{
return AfxGetThread()->PreTranslateMessage(pMsg);
}
END_TRY
return FALSE;
}
The variations in this method did not help.
I can trace the flow from the main app via PreTranslateMessage into the DLL.
Clicking on any button on the modeless dialog hangs the code.
I would welcome any comments but best of all a working sample.
Thanks to everyone.
Paul
|
|
|
|
|
You have used AFX_MANAGE_STATE(AfxGetStaticModuleState()); to switch to dlls context, so when the messages are translated in the main thread the sate is not correct. May be this is crashing, In Debug mode you should get an assert.
P.R.A.K.A.S.H
|
|
|
|
|
Thank you for your suggestion.
It got me thinking about the dialog style. In the main exe where I have a number of modeless dialogs, I set the dialog style to include control. This has the effect in the main exe of allowing the tab key to move between the controls on any modeless dialog. When the last control is exited (loses focus), the dialog style causes the tab key to move out of the current modeless dialog and enter the next modeless dialog.
But in the case of the DLL, this was not correct. The solution turned out to be to clear the dialog style settings and leave only the Visible checked.
Once I solved this small hitch (like two days later), I then discovered that while the tab key works properly inside the modeless Dialog created by the DLL, the effect of leaving the DLL was disabled. This was because the control style was not set.
In the end, I settled for raising an event (i.e. callback) on one of the controls in the DLL that changed the focus to a control in the main app.
in the following example, MyModeless was the hWnd returned from the DLL for the dialog
BOOL CMainEXEApp::PreTranslateMessage(MSG* pMsg)
{
if (TheView->MyModeless!=NULL)
{
if (IsDialogMessage(TheView->MyModeless, pMsg))
return TRUE;
}
return CWinApp::PreTranslateMessage(pMsg);
}
void CMainEXEApp::ChangeTabOrder( void * pPointer)
{
if (pPointer ==NULL)
{
SetFocus(TheView->GetDlgItem(IDC_BUTTON2)->m_hWnd);
}
}
Thanks for the response
paul
|
|
|
|
|
Hi,
I would like to lead execution of my program with keyboard. I need function which will wait for keyboard input and would not spent any processor time.
Is it possible to use GetMessage() and message queues (window based aplications) in console application?
Tomaz Rotovnik
|
|
|
|