|
I would do it in the WM_KEYDOWN handler. check if the key you want is pressed and use GetKeyState(VK_CONTROL) < 0 to check if the control key is down. If both these conditions are present, call your handler, or else call the default WM_KEYDOWN handler.
HTH
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Orgasms are universal!! -- Mike Mullikin in The Lounge 21:27 15 May '02
|
|
|
|
|
Hello,
Does anyone know where I can find an example (or could someone post an example) of how to Double Buffer my MDI ClistView? I have done extensive searches on Codeproject and Codeguru but all I can find is examples for CListCtrl's which dont seem to work with the CListView. (esp. when I resize the window).
Thanks
Rob
|
|
|
|
|
Have you tried subclassing the underlying list control (accessible with GetListCtrl ) and doing the double buffering stuff there?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've never had enough trouble w/ flicker to bother, but really, the process should be the same as for a CListCtrl - at heart, that's what CListView is. What have you tried?
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|
Perhabs you could also try to suspend redrawing when changed occurs:
send WM_SETREDRAW with a boolean flag to the list do the work
|
|
|
|
|
That sounds like a good suggestion. You might want to reply to the original poster though, so he gets email notification.
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|
Hi.
I am in the debugging phase of a simple message program using Winsock API. The program has both server and client features. The user can choose to be a server or a client. Anyways, everything works including server start, stop, accept client, and send data. However, I am having problems receiving data. WSARecv fail with the error WSAEFAULT.
-----
// WSAEFAULT: "Bad address"
-----
I have tested both sides. I get the same error no when I try to receive data from the server end and from the client end. Again, sending the data works fine, its just that I cannot receive the data.
Here is the function to read the data.
-----
if (socket != INVALID_SOCKET)
{
DWORD bufferSize = 0, receivedSize = 0;
WSABUF bufferHDR,
bufferDATA;
char *header = new char[4], *data;
bufferHDR.len = 4;
bufferHDR.buf = header;
// The program never makes it pass this point
if (WSARecv(socket, &bufferHDR, 1, &receivedSize, 0, 0, 0) == 0)
{
bufferSize = static_cast<dword>(*bufferHDR.buf);
data = new char[bufferSize];
bufferDATA.len = bufferSize;
bufferDATA.buf = data;
receivedSize = 0;
DWORD bufferProgress = 0;
while (receivedSize < bufferSize)
{
if (WSARecv(socket, &bufferDATA, 1, &bufferProgress, 0, 0, 0) == 0)
{
newData += bufferDATA.buf;
receivedSize += bufferProgress;
}
else
{
DetermineErrorWSARecv();
receivedSize = bufferSize;
}
}
UpdateAllViews(NULL);
}
else
DetermineErrorWSARecv();
delete [] data;
delete [] header;
}
-----
Have you experienced a similar problem?
Thanks,
Kuphryn
|
|
|
|
|
I'm not sure about this, but maybe you need to provide an lpFlags parameter (initialized to 0).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks.
JuNC brought up that point at GameDev as well. I tried to pass ni MSG_OOB, but I believe WSARecv wants a LPDWORD. I am not sure about how to convert MSG_OOB to an LPDWORD variable.
Kuphryn
|
|
|
|
|
Okay. The solution to set declare a DWORD and pass that variable into the function (referece).
-----
// DWORD flags = 0;
// WSARevc(socket, &bufferHDR, 1, &receivedSize, flags, 0, 0);
-----
Kuphryn
|
|
|
|
|
Hi!
Anybody know how can insert menu and menu items on Visual C++ Ide, like Checkbounds does?
I'm looking in MSDN but I can't find information
Thanks in advance.
|
|
|
|
|
Check Nick Hodapp's superb article Undocumented Visual C++.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i write this code for delete 0.0.0.0 like route delete 0.0.0.0 , in winxp this code work fine,but in win98 not work...return invalid param...
look this code i help me please
PMIB_IPFORWARDROW pRow = NULL;
ULONG dwSize = 0;
DWORD dwStatus = 0;// Allocate some memory to store the row
inpRow = (PMIB_IPFORWARDROW)malloc(sizeof(MIB_IPFORWARDROW));
if (!pRow) {
MessageBox( NULL,TEXT("Malloc failed, Out of Memory!\n") , NULL, MB_OK );
exit(1);
}
pRow->dwForwardDest = inet_addr("0.0.0.0");
pRow->dwForwardNextHop = inet_addr("192.168.0.220");
pRow->dwForwardMask = inet_addr("0.0.0.0");
pRow->dwForwardIfIndex = 2;
pRow->dwForwardType = 4;
pRow->dwForwardProto = MIB_IPPROTO_NETMGMT;
pRow->dwForwardAge = 0;
pRow->dwForwardMetric1 = 1;
dwStatus = DeleteIpForwardEntry(pRow);
if (dwStatus == NO_ERROR)
MessageBox( NULL,TEXT("Route Added Successfully!\n") , NULL, MB_OK );
else
if (dwStatus == ERROR_INVALID_PARAMETER)
MessageBox( NULL,TEXT("Invalid Parameter!\n") , NULL, MB_OK );
// Free resources
if (pRow)free(pRow);
|
|
|
|
|
any idea ???
i try change all parm but in in w98 not work i have error "invalid param.." in winxp this work fine O_O
|
|
|
|
|
How do you put letters in a matrix instead of numbers? Char? Will it be able to convert to int?
|
|
|
|
|
Yes, an array of char s is fine to store letters. The conversion of char s to their numerical equivalents is done automatically like this:
char ch='A';
int i=ch;
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
I have tried to use the /delayload linker switch for the VC++ 6, but I've got
error LNK2001: unresolved external symbol __tailMerge_
when trying to delayload more then one dll.
To be more precise:
-I want to create test.dll that links against dll1.dll and dll2.dll
-dll2 is also linked against dll1
-trying to delayload both dll1 and dll2, I've got the above mentioned linker error for dll1
I would appreciate any solution or explanation why this happens.
Cristina
|
|
|
|
|
I got the 'Illegal Operation' message when I move the mouse pointer over my toolbar. I get an 'Access Violation' message and a file named 'Disassembly' pops up upon debug. What kind of conflict am I dealing with here? Thx.
ralf.riedel@usm.edu
|
|
|
|
|
How do I get information from a dropdown menu (from html page in CHtmlView) to a variable in my c++ application?? I have searched all over and need some help.
(Developing in MSC++6.0 sp5 & IE6.0)
|
|
|
|
|
Hopefully you are comfortable with COM because this requires you to do a lot of interface navigation. You will need to dig down into the HTMLDom and access the particaly HTML Element that you are interested in.
The basic idea is to start with the IWebBrowser2 itnerface from your CHtmlView, then get the IHTMLDocument from the browser interface.
Next cycle through all of the Child elements until you find the menu you are interested in.
Once you have that you should be able to access the elements of that menu for the data you are interested in.
Good Luck!
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
The basic way to do this is to use the COM interface exposed by the WebBrowser control and find the element you are interested in and interogate its properties.
Another way this can be done is to have an onchange event for the drop down that redirects to a URL like customstuff:myvar=1 type of thing. Then in your CHtmlView class you can overide the OnBeforeNavigate2 (maybe OnBeforeNavigate??) function and check for the customstuff: prefix and set your variable accordingly. Remember to cancel the navigate, of course.
Another way is to use the wonderful DHTML UI library provided by Ted Crow. (http://www.codeproject.com/useritems/dhtmlui.asp). This library will allow you to expose your applications object model to the HTML windows being displayed though the window.external property.
|
|
|
|
|
I have a program that i want to organize mp3's with. But, i've come to a place where i need to store a path for every item in a ListView control, so when i add some new items to the list, the pathlist gets larger and i can retrieve the path somehow.
What would be the best solution?
Thanks
|
|
|
|
|
Are you talking about retrieving the path pragmatically in your program, or visually to the user.
If you are talking about pragmatically, have you tried associating the data with each element in your list view?
You can either just associate the path string with each item, or you could create a structure that contains any amount of data that you want and set the pointer to the structure in teh user data of the list view item.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
How do i assign a path to each item?
|
|
|
|