From what Richard replied, and re-reading your message, I guess you have a button, and a picture control on your dialog, and they overlap.
What you need is a button which shows its own picture. You can attach an icon to the button from the resource editor, or you can use one of the many picture button controls available here: http://www.codeproject.com/KB/buttons/[^]
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
I have a button and a bitmap. I am using CSkinButton class to set normal & hover state bitmaps on the button. I want to position the button on the right of the screen (similar to "feedback" button we normally see on various websites.) Now my computer screen size is larger, So when I position the buttons on the right side according to my computer screen size, its ok , but if I use this exe on some other computer which has a smaller screen size, button are not visible properly.
I want to place the buttons in the middle-right of the screen.
Just position it somewhere where the controls don't overlap. You can have overlapping controls but it's really not worth the hassle. By the way, you can always get the size and position of your other control and do some math to figure out the proper placement of the button under it (if you're creating the controls at run-time).
Low level of MFC is the Win32 API. Open the context menu by right clicking on a call to CListCtrl::GetItemCount() and choose 'Go to definition'. You will see that it is an inline function that sends the LVM_GETITEMCOUNT message to the list control window. This message is not processed while your GUI thread is blocked.
A general rule is: Never block GUI threads. If you have to wait for events, do this in worker threads.
1) Write a exe program that uses your COM.
2) Launch the exe.
3) Open your COM Project is Visual Studio
4) Attach the already running exe with the Project.
5) Keep the break points and start debugging it.
see am not able to understand the 4th step.
attach in the sense by changing the configuration properties in that debugging and then
command and passing the path of the exe. if this the way then its control not coming to break point or i may be wrong to the exe ....
hi ,thanks ...
one more thing i want to ask how to register the dll .
am getting the error message that DLL has loaded but entry point DllRegisterserver was not found ...
but am wtritten the code for it
HRESULT hr = RegisterServer (AfxGetInstanceHandle(), // handle to dll module
CLSID_CCmpnt, // component CLSID
g_szFriendlyName, // friendly name
g_szVerIndProgID, // version independent prog id
g_szVerDndProgID); // version dependent prog id
its in a function name STDAPI DllRegisterServer(void)
the control not coming in this function what might be cause please reply
ok sorry ..
the code i build in 32 bit its success but when i configure the VS 2010 for 64 bit the error message con not instantiate the
HRESULT IContextMenu::GetCommandString(UINT_PTR,UINT,UINT *,LPSTR,UINT)' : is abstract
see declaration of 'IContextMenu::GetCommandString'
why this conflict
In DLL i have written the code for Context menu in vs2010 using COM
i derived the class CRsEraser : public IContextMenu, public IShellExtInit
this IShellExtInit and IContextMenu is are com class
when use it
CRsEraser *pCmpnt = new CRsEraser;
if (pCmpnt == NULL)
HRESULT hr = pCmpnt->QueryInterface (iid, ppv);
// Release the IUnknown pointer
CRsEraser *pCmpnt = new CRsEraser;this part showing its abstract class .
in 32 bit compile its working fine same when configure to 64 bit its throwing the error what i have mention earlier .
how i configure:
1 Open your Visual C++ Solution
2 Choose Build->Configuration Manager menu
3 Inside the Configuration Manager window, change the ‘Active solution platform’ to x64. If you don’t have any, you would need to create one by selecting the ‘New..’ drop down item. Copy settings from your Win32 platform.
4 Now rebuild your solution.
Error 1 error LNK2019: unresolved external symbol EnterStub referenced in function EnterNaked2
Error 2 error LNK2019: unresolved external symbol LeaveStub referenced in function LeaveNaked2
Error 3 error LNK2019: unresolved external symbol TailcallStub referenced in function TailcallNaked2
How to solve this
Look at the error messages. They are telling you that certain external functions that you reference cannot be found within the project. Find out where these are supposed to be defined and ensure that they are externalised.
I was a graduate student in Tsinghua University in China.
I'm programming about NC Code Simulation System.
In this program, I used OpenCSG Library to perform a Solid Modeling.
By the way, the sample program supported by library which is programmed in Win32 App, is well operate, but the program that I produced in MFC doesn't well operate. The error is that OpenCSG doesn't draw solid.
How to use OpenCSG Library in MFC?
I have created a console application (.exe), and we have used SetConsoleCtrlHandler for signal handling i.e. "CTRL + C" and Log Off and Shutdown Events.
We are properly able to handle the "CTRL+C" event but Logoff and Shut down events cannot be handled properly.
Following content is mentioned at MSDN:
The system generates CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT signals when the user closes the console, logs off, or shuts down the system so that the process has an opportunity to clean up before termination. Console functions, or any C run-time functions that call console functions, may not work reliably during processing of any of the three signals mentioned previously. The reason is that some or all of the internal console cleanup routines may have been called before executing the process signal handler.
Please suggest how we can properly handle Logoff and shutdown event by our console application.
Or please suggest any other technique (if available) for handling the logoff and shutdown event by the console based application.
In .NET we have the System.IO namespace providing convenient classes for Sockects and Pipes which ay be used for interprocess communication. How can one implement this in oldskool VC6?
My requirements are as follows.
I am writing a plugin for some legacy software for which there is a SDK which I can only get to compile with VC++6.0 compiler. I want to interface this code with both .NET and JAVA. I was thinking of implementing either a Socket server or Namedpipe in C# to act a a bridge between the VC6 code and .NET/JAVA. Requests from VC6 would be in the form of byte arrays and the C# bridge would interpret these requests, route them and eventually reply to the VC6 code which is awaiting a response.
In summary I would like examples of the following in VC++6:
- Use of threads
- Socket/Pipes (or any other interproc comms method)
- Invoking a process (other than a shell call to an executable)
BTW non-MFC is required
Any suggestions would be great.
Last Visit: 31-Dec-99 19:00 Last Update: 26-May-15 21:01