|
CPoint cpPoint;
GetCursorPos(&cpPoint);
(SDK version)
|
|
|
|
|
Hi all. I already written a MFC application and I also got the code for a demo on the usage of cximage. Since this demo code is very long and complicated, I do not know how to use it in my currently avaliable application. Can someone advise me on how to do it. Thank you for any advise.
|
|
|
|
|
Hi to you all !!!
When i'm trying to use socket i get very often the following assertion:
"Assertion Failed on Line 851 - Sockcore.cpp"
When entering to debug the line that comes out is:
"ASSERT(pState->m_hSocketWindow!=NULL)"
Some overview of my project:
1) it has two main programs : a server that is written in VC++ 6
and a client that is written in C#.
1) The server doesn't use a static MFC library.
2) The server has some threads that uses a global tcp/ip classes,
These Tcp/IP classes ( instanses of CSocket ) protect the Send
method with a CriticalSection object, so only one thread can send somthing
to the connected clients.
These assertion can be produced repeatedly when the server is running and
the client application ( after being connected and recieving messages from the server correctly ) is debuging in a step-by-step mode.
This assertion also accours sometime while the client is running and is not in debuging mode.
I hope that some of you guys will be able to help me.
Thank you very much.
Conarius.
|
|
|
|
|
what do u mean by very often?
did u call AfxSocketInit at the program's startup routine?
...
Don't try it, just do it!
|
|
|
|
|
Yes , i have.
And "very often" is after 1 or 2 minutes of debug mode.
|
|
|
|
|
Hi every body,
I want the event(notification) of new window creation, so that I can get the handle to that window, and do whatever things I want to do with it.
I am able to get this event using sytem-wide CBT hook. But because of this sytem-wide hook I am unable to get access to functions of components which are part of OLEACC.DLL because of shareability problem.
So I want to get this event(CreateWindow) by some other way(other than global hook). If there is some work around please help.
Avya.
|
|
|
|
|
does anyone know how do i attach exe and other files to a code so when i run the the compiled program it will install the files
|
|
|
|
|
|
Very good point of view Michael
|
|
|
|
|
you do really sound like a bad hacker...
but let's assume u'll use this for an installer:
you could add files as resources(if they aren't very big), then use your software to extract them.
Don't try it, just do it!
|
|
|
|
|
Relax guys. im not going to write a virus and im certinly not a hacker
all im trying to do is a basic multi installations file that will run several installations file depending on the conditions of the system and the server which runs the installations without any user interference. this could have been solved in simple bash script if it was unix.
but since i need it running on windows clients i would have to use a c solution.
*.Think again.... and again and again and again and again
|
|
|
|
|
Hello,
Does anyone have any pointers to articles about making a multi-line list control? I've searched here and cannot seem to find this specific issue.
thanks! JennyP
|
|
|
|
|
I've written one, but that was for work, so I can't post code.
As I recall, I handled WM_MEASUREITEM to reflect the number of lines I wanted, then handled either NM_CUSTOMDRAW or WM_PAINT to paint the text (I can't recall). This was on Windows CE, so you might need to do things differently. This technique only works if all items are the same height, though - that is, they have the same number of lines.
|
|
|
|
|
What is the best way to open a image file and get
access to the raw bytes of the image so that I can
apply various algorithms from Intel's IPP library.
Also what about allocating the wright ammout of memory?
Can I just use GetFileSize or the like to get the required
size of the buffer?
Thank You
Bo Hunter
|
|
|
|
|
depends on what kind of image you want to load...
loading a BMP file is really easy, you have to read the header, allocate memory for the bitmap and read the rest of the file.
Don't try it, just do it!
|
|
|
|
|
I want to write an application that knows when it is closed from the Task Manager and it can prevent it from happening
|
|
|
|
|
having viral thought or what?;P
check this out (im not sure about this):
use CreateThread() and check out the security descriptors; maybe these things are useful.
|
|
|
|
|
Hiii,
I want to control the individual pins of Serial port using VC++. I need to retrieve Data, Read/Write enable and Software driven Clock from it.
I've checked "Hardware Interface Programming in VC++ - Part I (Port Access) By Jaygiri". It's really good.
Waiting for the artical controlling Serial Port.
Plzzzzzzzzz reply as soon as possible.
|
|
|
|
|
see if this help
http://www.codeproject.com/system/serial.asp
for toggling pin, you may check handshaking stuffs and SetCommState api.
regards,
jim
|
|
|
|
|
Hiii,
I cannot use SetCommState as I don't want to set the baud rate of the port.
I don't want to use RS-232 protocol.
I think it can be done using _inp() n _outp() functions but don't know how. Help required.....
Plzzzzzzzzzzzzzz send reply as soon as possible.
Thanks in advance.
|
|
|
|
|
Hello all,
I'm having difficulties to get the string of a menu item pressed.
What I'm doing is writing a IE toolbar and in one of the pull down menu's I dynamically add popup menu's which are also dynamically filled.
Just for a theoretical example let's say I have a button 'drives' on the toolbar. Pressing the pulldown menu will add some menu entries (the same amount of disk on my system, C; D; E; ...).
Every menu item is a popup itself, and a dynamically created Popupmenu is attached - containing the root level directories for the selected drive (temp, program files, winnt, ...).
Following is an adapted piece of code, but it works how it suppose to
<br />
MENUITEMINFO mmi;<br />
mmi.cbSize=sizeof(MENUITEMINFO);<br />
mmi.fMask=MIIM_STRING | MIIM_DATA | MIIM_SUBMENU;<br />
<br />
char fn[50];<br />
<br />
for (int i=0; i<3; i++)<br />
{<br />
HMENU hMenuToInsert;<br />
hMenuToInsert = CreatePopupMenu();<br />
{<br />
char drv[255];<br />
while (getthedrives)<br />
{<br />
sprintf( drv, "%s", a_directory);<br />
AppendMenu(hMenuToInsert, MF_ENABLED|MF_STRING, ID_DUMMY, drv);<br />
}<br />
}<br />
sprintf( fn, "Drive %s", drvletter);<br />
mmi.hSubMenu = hMenuToInsert;<br />
mmi.dwTypeData = fn;<br />
mmi.fType=MFT_STRING;<br />
InsertMenuItem(m_hDriveMenu, 2+i, TRUE, &mmi);<br />
<br />
}<br />
The problem I'm having is, is that I'm using a dummy ID (ID_DUMMY).
When my ON_COMMAND fires, I have no way to get the correct menu item using GetMenuItemInfo because
a) I'm using the same id for every popup menuitem inserted
b) I'm reusing the HMENU (hMenuToInsert) for my popmenu's
Does anyone know of a simple way to get the text of the menu (directorys on a drive in my case) pressed?
Thanks
Wim
|
|
|
|
|
|
Hi Michael,
I'm reusing them because I really have no clue how many directories I will have.
Let's say I have 10.000 directories, that means I have to define 10.000 unique id's. You know of a way to create that many on the fly, or maybe a better way to do it?
The other problem I have then is to what popupmenu the directory I clicked belongs (C:, D:, E , but I supppose I can have a list of HMENU id's and I check every list/MENU_ID for success.
Thanks
Wim
|
|
|
|
|
Well, command IDs can be in the range 1-65535. Just start a counter a 1 and increment it for every menu item you add. Each menu under the first level can use 1-65535, you don't need a unique ID for every single item if you think you'd ever have more than 65535. You can tell which top-level popup has been selected by handling WM_MENUSELECT , and from there you can work out which directory was selected.
You should also give the top-level popups IDs for easier tracking (and those IDs shouldn't be duplicated in the submenus). You can do this with InsertMenuItem() .
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0.1! | RightClick-Encrypt
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Ok,
I see it now. One thing what I discovered when playing with the WM_MENUSELECT was that I couldn't get the (a random) text from my popup menu (just for a test, take the first entry of the popupmenu, I will move it to the WM_COMMAND later).
What I did was this:
<br />
LRESULT CMyToolBar::OnMenuSelect(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)<br />
{<br />
if (lParam&&(HIWORD(wParam)&MF_POPUP))<br />
{<br />
HMENU hSubMenu = GetSubMenu ( (HMENU)lParam, LOWORD(wParam));<br />
<br />
MENUITEMINFO mii;<br />
mii.fMask = MIIM_STRING;<br />
<br />
char c[2000];<br />
mii.dwTypeData=c;<br />
mii.cch=2000;<br />
<br />
GetMenuItemInfo(hSubMenu, 0, TRUE, &mii);<br />
MessageBox(mii.dwTypeData);<br />
}<br />
return 0;<br />
}<br />
According to the documentation, lParam contains the Handle to the menu I pressed (the main menu), and if HIWORD(wParam) contains flag MF_POPUP, the LOWORD(wParam) contains the the position pressed in the menu.
If I use GetSubMenu((HMENU)lParam, HIWORD(wParam)), I should get the handle to my popupmenu containing the directories, right?
I outputted the parameters, and the handle and index looked OK.
But when I used GetMenuItemInfo using the handle obtained with GetSubMenu and index 0 (the first Item in the popup menu), it returns an empty string.
Any idea what I'm doing wrong?
Thanks
Wim
|
|
|
|