|
My Borland C++ 4.5 compiler could understand classes etc, but it dod not use classes to represent any Windows processes.
|
|
|
|
|
Anthony Appleyard wrote: but it dod not use classes to represent any Windows processes.
It did if you used OWL, just like VC++ does when you use MFC.
Mark
|
|
|
|
|
Anthony Appleyard wrote: so I can see how to program for Windows using classes (e.g. the class called "Window")?
Where did you see a class called "Window"?
As mentioned by Hamid, Visual C++ (non-Express versions) comes with the MFC
library which is a class-based framework wrapping the Win32 APIs.
If MFC is what you are interested in, you can build a fully functional
MFC application with the project wizards. See File/New/Project... in
Visual Studio.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have got my program project working. With thanks to all who have answered my queries. (I have the free download version of Visual C++ 2008.) (It is like Windows Character Map, but its display is much bigger and clearer, and it can handle all 65536 Unicode characters.) This query arises: Can the resulting ---.exe file run on another computer? Or what needs to be doing to it or to be uploaded along with it?
|
|
|
|
|
Im sorry understand what you said?
|
|
|
|
|
|
Hi All,
I have very serious problem regarding using DllMain() function in my application.I have created MFC Activex Control in VS2005.
I have created one .cpp file in that I want to use DllMain() function as below....
BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)<br />
{<br />
}
But when I use this function (At least these three lines.. ) I got an error like below....
Hooking.obj : error LNK2005: _DllMain@12 already defined in mfcs80ud.lib(dllmodul.obj)<br />
ActivexVS05.ocx : fatal error LNK1169: one or more multiply defined symbols found
I have searched for this error in google but I could not found the solution.
If you have any suggetion and solution then please reply me.
Thanks in Advance.
|
|
|
|
|
MFC implements DllMain for you. Override the InitInstance method instead.
Read the DllMain[^] article very carefully, and the Best Practices for Creating DLLs[^] white paper. Note particularly that calling MFC methods may not be safe if MFC has not yet initialised, if you're using MFC in a shared DLL.
In general I would recommend avoiding any initialisation steps in DllMain and instead perform them in the class itself (perhaps in the constructor).
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi,,
Sorry for the very late reply.
Thank you very much for reply.I have read the article as you told and I have solved this problem but now I am facing new problem regarding this topic.
Now I am using below code for the my project purpose using Dllmain().Here I have created one DLL in that I am using this function.In this DLL what happens that this DLL checks for screen update and mouse update on the desktop and sends messsages to my MFC Activex Control (which is another project in the same Solution).
<br />
BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)<br />
{<br />
hInstance = (HINSTANCE)hInst;<br />
<br />
<br />
return TRUE;<br />
}<br />
And now problem is when I run my Activex from Activex control test Container then whenever this test container is active on top of the desktop then messages(like Scrren update,,Mouse update)are peeked up by Activex control application but when any other window is active then these messages are not peeked by Activex.
Is the problem with this hInstance which get the instance of the window in which My Activex is running???
I ahve tested running my activex in explorer but the same problem exists.
I peeked up these messages from my Activex by below code....
<br />
MSG msg;<br />
while(1)<br />
{<br />
if(!PeekMessage(&msg,m_desktop->m_hwnd,NULL,NULL,PM_REMOVE))<br />
{<br />
if(!m_desktop->CheckUpdate())<br />
break;<br />
if (!WaitMessage())<br />
{<br />
AfxMessageBox(CString("WaitMessage Failed"));<br />
break;<br />
}<br />
}<br />
else if(msg.message == SCREEN_UPDATE)<br />
{<br />
}<br />
else if(msg.message == MOUSE_UPDATE)<br />
{<br />
}<br />
<br />
}<br />
Please give me any suggetion if you have any idea or ask me if you have any more quetions.
Thanks in Advance.
Ashish Bhatt
|
|
|
|
|
Also, study this to make sure you're using the correct form of MFC DLL
and initializing it properly...
Kinds of DLLs[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For example, there are two images with the same size.
One is a normal pic, the other is a mask bitmap.
The colors in the mask one are composed with black and white (including gray).
Now let gray level become transparency.
Put the mask bitmap onto the normal one, and get the image.
How to do it with GDI+?
Thnaks.
|
|
|
|
|
AFAIK, GDI+ doesn't have built-in code for image masks. Transparency is handled with alpha
channel instead.
You could step through the pixel values of the mask and based on each value, adjust the
alpha value of each pixel in the other bitmap.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, I'll do this way.
Thanks.
|
|
|
|
|
I want to init CListCtrl, m_hWnd of CListCtrl must be available,
where to put the init code?
|
|
|
|
|
Can you reformulate you question (give more details)?
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.
|
|
|
|
|
class CMyDialogBar:public CDialogBar
{
...
public:
CMyListCtrl m_list;
...
}
CMyListCtrl::OnCreate()
{
}
|
|
|
|
|
Does your CMyListCtrl inherits from CListCtrl?
Can you detail a little more (sorry for the insistence)?
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.
|
|
|
|
|
How did you make your listbox? visual or dynamic
|
|
|
|
|
|
So you can declare a variable for it and use of its hWnd.(m_ListCtrl.m_hWnd)
|
|
|
|
|
Because the list control is already created by the time it is attached to your CListCtrl variable.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
When not in a dialog bar, it is ok.
|
|
|
|
|
Hello everyone,
I am wondering the default implementation of assignment operator (e.g. when we do not implement assignment operator in user defined class, what will be returned? temporary object? reference or const reference? deep copy or shallow copy is used in default assignment operator?)? I have the C++ Programming Book at hand, but can not find it from Index page.
thanks in advance,
George
|
|
|
|
|
George_George wrote: I am wondering the default implementation of assignment operator (e.g. when we do not implement assignment operator in user defined class, what will be returned? temporary object? reference or const reference?
A reference. (*this ).
George_George wrote: deep copy or shallow copy is used in default assignment operator?
Shallow copy.
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.
|
|
|
|
|
Thanks CPallini,
My question is answerd! Cool!
have a nice weekend,
George
|
|
|
|