|
Maybe you can turn your VC++ program into a COM object so that VB could use it. Maybe a simple non-mfc dll will do the trick.
|
|
|
|
|
Hi,
Thanx!
But i am a beginer and i am not familiar with COM and could you please elaborate more on that non-mfc dll.
Bye
|
|
|
|
|
Sorry, it is not a non-mfc dll. It is a MFC regular DLL.
A regular DLL can be linked to MFC dynamically or statically. It uses MFC internally and the functions
it exports can be called by either MFC or non-MFC executables. The client program can be written in any
language that supports the use of DLLs (C, C++, Pascal, Visual Basic, etc.); it need not be an MFC
MFC application. Please refer to MSDN documentation for further details.
|
|
|
|
|
A non-MFC DLL is a DLL that does not use MFC internally, and the functions it export can be called by either MFC or non-MFC programs. Functions are usually exported from a non-MFC DLL using the standard C interface.
Since your program is in VC++, you might want to try MFC regular DLLs.
A regular DLL uses MFC internally and the functions
it exports can be called by either MFC or non-MFC executables. The client program can be written in any
language that supports the use of DLLs (C, C++, Pascal, Visual Basic, etc.); it need not be an MFC
MFC application. A regualr dll cannot export MFC objects. Please refer to MSDN documentation for further details.
|
|
|
|
|
Hi VC Student
I wrote a simple project by MFC dialog based exe.
Now i want to write it again in .DLL in VC++.
Our Delphi programmer could use of my DLL, only by LoadLibrary function ...
Can you tell me how could i do it, please ?
First problem is, Because LoadLibrary can load functions from DLL.
And in MFC i used classes !
Second problem is, I heard other programming languages like Delphi cannot use the MFC DLL extension ...
Could you tell me how can i do that ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi! all,
How we can determine programatically whether the system is in DOS Mode(Full Screen) or Windows Mode, using WIN32 programming supporting OS from Win95 to WinXP? Thanx in advance..
Debabrata.
Debabrata Debnath
India
|
|
|
|
|
The following functions may be of use :-
GetConsoleScreenBufferInfo
GetLargestConsoleWindowSize
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
how to deal with taskbar programmatically?
such as add or delete item from it,hide or how it,and so on.thanks
|
|
|
|
|
Hi everybody,
For my application, i need to calibrate some parameters, some technical articles explain that i should use a minimization method which is called Levenberg-Marquart method. I show an explanation coming from numerical recipes in c, but i don't have the book with all the library i will need. And, as i'm not a specialist in this kind of code, i'm not sure that i understand all the code given in the article. So, i would like to know if someone could help me to understand the code;
thanks in advance
gerald
|
|
|
|
|
I want to monitor a RAS connection (received and send bytes). I try with CRasMonitor but it not work in w2k.
misu
|
|
|
|
|
i m jus a beginner to VC++
how can i create a new childframe to display a new document under MDI?..take for instance a button 'process' located at the toolbar so that when i click on it, a new childframe containing the document i desired will appear.
pls help mi on this simple problem. thanks to all experts out there
|
|
|
|
|
You should be able to locate a document template pointer in the CYourApp class of your MFC project (I assume its MFC your using). What I do is have the CMainFrame contain a member variable which is a document template pointer type, and when the CYourApp starts and it creates the CMainFrame, I have the MainFrame template variable = the newly created template pointer. This gives you instant, easy access to the template without having to iterate through all the document templates in the CYourApp class, and also gives you much easier access to doing what you want (the pointer is deleted by the document template system so you don`t need to worry about deleting it or memory leaks either!). This template can be used to create a new document and a new child window using the following code :
void CMainFrame::NewChild()
{
CMyDoc* pMyDoc = (CMyDoc*)pTemplate->CreateNewDocument(NULL);
CMyWnd* pMyWnd = pTemplate->CreateNewFrame(pMyDoc, this);
pTemplate->InitialUpdateFrame(pMyDoc, pMyFrame, TRUE);
}
Hope this helps,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
dear Mr Alan
thanks a lot for your great help
but since i am a beginner to this..i am not too sure of the docu template pointer u refer to.
when i compile, how should i declare my pTemplate as?
is this pTemplate u refer to as the docu Template pointer?
wat should i put for the variable type for pTemplate?
would appreciate if u haf a copy of source code to refer to me. (kiplier@hotmail.com)
thousand thanks
|
|
|
|
|
OK, the code you should refer to is in the InitInstance function of your CYourApp class (where CYourApp is the class that encapsulates your whole application and its name depends on what you set it too), and it looks like this :
CMultiDocTemplate* pDocTemplate;
pTemplate = new CMultiDocTemplate(
IDR_YOUR_MENU,
RUNTIME_CLASS(CYourDoc),
RUNTIME_CLASS(CYourFrame),
RUNTIME_CLASS(CYourView));
AddDocTemplate(pTemplate);
CMainFrame* pMainWnd = new CMainFrame;
...
m_pMainFrame = pMainFrame;
m_pMainFrame->m_pTemplate = pTemplate;
when i compile, how should i declare my pTemplate as?
you declare your pTemplate as a CMultiDocTemplate*.
is this pTemplate u refer to as the docu Template pointer?
Yes.
wat should i put for the variable type for pTemplate?
the variable type is a CMultiDocTemplate*
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
how to change the keyboard's Num Lock status programmatically?
|
|
|
|
|
take a look at SetKeyboardState
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
The documentation for SetKeyboardState() correctly says that you cannot use this API to toggle the NUM LOCK, CAPS LOCK, and SCROLL LOCK keys.
|
|
|
|
|
You read it wrong friend.
What the documentation says is that the indicator lights won't get turned on/off, but the states DO CHANGE for the calling thread.
[snip]
Because the SetKeyboardState function alters the input state of the calling thread and not the global input state of the system, an application cannot use SetKeyboardState to set the num lock, caps lock, or scroll lock indicator lights on the keyboard
[/snip]
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
See MSDN Article
http://support.microsoft.com/support/kb/articles/Q127/1/90.asp
for answer
|
|
|
|
|
Hi,all
Is the OnPaint function in MFC just the same as the content between BeginPaint and EndPaint in SDK????
Does the system create WM_PAINT after it receive WM_SETCURSOR?
Now there are some problems in my application.I describe
it simply just as below.
Firstly:
OnPaint()
{
LoadBigBitmap(); //can fill the whole client view
if(m_flag)
LoadSmallBitmap();
}
OnLButtonDown()
{
m_flag=TRUE;
Invalidate(FALSE);
UpdateWindow();
}
OnSetCursor()
{
// set my own Cursor and return TRUE
}
Then, when I run this application, errors occurrs.
First, it display the BigBitmap .
After I click down on the client view, then it would display
the SmallBitmap,although,just for a while. then when I move
the cursor the SmallBitmap will disappear.
It disturbs me for long time, who can help me???
All your help will be appreciated!
Regards.
|
|
|
|
|
some extracts from the mfc-sources:
CPaintDC::CPaintDC(CWnd* pWnd)
{
...
::BeginPaint(m_hWnd = pWnd->m_hWnd, &m_ps);
...
}
CPaintDC::~CPaintDC()
{
...
::EndPaint(m_hWnd, &m_ps);
...
}
void CView::OnPaint()
{
// standard paint routine
CPaintDC dc(this);
OnPrepareDC(&dc);
OnDraw(&dc);
}
So you are right: BeginPaint begins within the constructor CPaintDC dc(this), EndPaint is called from within the destructor; it's called when the local CPaintDC goes out of scope and that's at the end of CView::OnPaint.
If you look more precise at the sources, you'll find out that some extra work is done by MFC (OnPrepareDC, ...)
Markus
|
|
|
|
|
When I insert the picture with the Dialog Editor and select type as a icon,I get the icon with size as 32x32!
How can I select size of icon?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello Eugene,
Double Click the icon-name from the Resource View to open it. Now press "Insert" on your keyboard. This will bring up the "New icon image" dialog. Select "Custom". Type in your width/height and press OK
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
I simply imported an icon, the size only 16õ16. On mine this same!
But the icon in dialog has all the same increased till the size 32õ32.
Any ideas!
|
|
|
|
|
Hi, i need some help with detecting when a CD is inserted or ejected from a drive. I've tried to override get the message handler...
afx_msg BOOL CWnd::OnDeviceChange( UINT nEventType, DWORD dwData );
but it doesn't seem to be called? The docs say that the WM_DEVICECHANGED message is sent to all top level windows? so shouldn't all the apps get this message.
If anyone has any code for this it would be really helpful
Thanks.
Jared Allen.
|
|
|
|