|
Yes.
Just send (or post) WM_LBUTTONDBLCLK (and similar) messages to a target window. However, you need to deliver the messages to the right target window, which can be easier said than done. (Finding the window can be non-trivial).
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
How can I use a progress control to monitor the transfer status of file being transferred to the pocket pc device. Any ideas?
Thanks
|
|
|
|
|
Dont write the whole file with CeWriteFile, instead write it in parts so you can update your gui while writing.
Here's some pseudo-code doing that:
while (totalbyteswritten != totalsize)
{
CeWriteFile(hDest, buff+totalbyteswritten, min(chunksize, totalsize-totalbyteswritten), &byteswritten, 0))
totalbyteswritten += byteswritten;
}
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
I want to convert int, long values to byte arrays, and from byte arrays back to int, long. I can do it with In .NET BitConverter class, but I want to do it in C++. any help greatly appreciated..
happy coding
|
|
|
|
|
Not sure if this is what you want:
char b[sizeof(int)];
int i=*reinterpret_cast<int *>(&b);
...
int i=...;
char b[4];
mempcy(b,&i,sizeof(int));
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi
I have a dialog which fits perfectly in a regular 17inch screen.
But with my friend, who has a 15inch screen, the dialog is too large to display.
How can i make sure the dialog got scrollbars on the 15inch screen, and not when the program is run with the 17inch screen?
Greetings
Bart
|
|
|
|
|
don't
Change your layout to fit the smaller screen size, using Tabs, and/or secondary dialogs.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
Oh, i've thought about that too
but that isn't possible.
|
|
|
|
|
Friends,
Please tell me that how can i change the background color of my dialog box at runtime.
Thanks.
|
|
|
|
|
Thanks for reply..one more question
How can i force repaint after applying your solution. For example on pressing the OK button of dialog box i call the following code:
AgxGetApp()->SetDialogBkColor( COLORREF clrCtlBk = RGB(192, 192, 192), COLORREF clrCtlText = RGB(0, 0, 0) );
But the problem is that the dialog is not repainted at that moment. Its only when i bring some other window on top of dialog, the dialog gets repainted with new background color. I also tried PostMessage(WM_PAINT) after the above line of code, but it is also not applying color ?
|
|
|
|
|
I want to list all sub-keys under a key. In my test I have two sub-keys. I open my key with ::RegOpenKeyEx() and then I put zero into first call for ::RegEnumKeyEx() . I call it again until it does not return ERROR_SUCCESS . This is my code:
HKEY hKey;
CHAR achKey[MAX_KEY_LENGTH];
DWORD i = 0;
if (::RegOpenKeyEx(HKEY_CURRENT_USER, REG_MAJOR_KEY, 0,
KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS)
{
while (::RegEnumKeyEx(hKey, i++, achKey, &cbName, NULL, NULL, NULL,
&ftLastWriteTime)) == ERROR_SUCCESS)
print("Found %s", achKey);
RegCloseKey(hKey);
}
The problem is it finds one key but not the other. Can anyone tell me where I am wrong please? Thank you.
|
|
|
|
|
Shouldn't you be checking against ERROR_NO_MORE_ITEMS instead?
while (::RegEnumKeyEx(hKey, i++, achKey, &cbName, NULL, NULL, NULL, &ftLastWriteTime) == ERROR_NO_MORE_ITEMS)
...
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Hello,
MFC CString has the += operator.. When dealing with char's how can one achieve the same thing?
I need to keep adding the contents of one char to the other while in a loop.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Use strcat() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks David!
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
One more question.. You answered my question correctly but I just realized that I was asking the wrong question.. Given the following code, can you give me any hints on how I can accomplish what I'm trying to do?
s_recv sRecv;
int nRecvSize = 0;
char outBuff[sizeof(s_recv)];
while(nRecvSize < sizeof(s_recv))
{
char inBuff[sizeof(s_recv)];
int nRecv = recv((SOCKET)wParam, inBuff, sizeof(inBuff), 0);
TRACE("Received %d of %d\n", nRecv, sizeof(s_recv));
if(nRecv == SOCKET_ERROR)
{
TRACE("MainFrm Recv Error %d\n", WSAGetLastError());
break;
}
else
{
if(nRecv == 0)
break;
strcat(outBuff, inBuff);
nRecvSize = nRecvSize + nRecv;
}
}
memcpy(&sRecv, outBuff, sizeof(outBuff));
Thanks for all the help...
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
RobJones wrote:
...can you give me any hints on how I can accomplish what I'm trying to do?
Assuming I knew what it is that you wanted to accomplish.
RobJones wrote:
strcat(outBuff, inBuff); // This doesn't work how I want it to..
So what is it doing instead?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The structure is like this...
struct s_recv {
int nTag;
char sTagMsg[256];
char sMsg[3072];
};
When I do the receive sometimes I dont receive the whole structure just a peice of it.. So I'm trying to store what I have received in a char and then keep appending the data until all the data is received..
Here is a output of the strcpy...
The inBuff contains..
[0] -75 'µ'
[1] 6 ''
[2] 0 ''
[3] 0 ''
[4] 110 'n'
[5] 111 'o'
[6] 110 'n'
[7] 101 'e'
[8] 0 ''
[9] -51 'Í'
etc.......
This is fine.. But when I do the cat..
the outBuff looks like this...
[0] -75 'µ'
[1] 6 ''
[2] 0 ''
[3] 0 ''
[4] 0 ''
[5] 0 ''
[6] 0 ''
[7] 0 ''
[8] 0 ''
[9] 0 ''
etc......
I think I need some way of doing a memcpy that appends instead of strcat...
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
RobJones wrote:
I think I need some way of doing a memcpy that appends instead of strcat...
You are correct. This is because the data you are receiving may have embedded '\0' characters, of which strcat() uses and memcpy() does not.
Try something like:
int nOffset = 0;
...
memcpy(outBuff + nOffset, inBuff, nRecv);
nOffset += nRecv;
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
YOUR THE MAN!
Thanks for all your help!
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I was passing through revolving door the other day, and i stopped half the way and hold the door real tight so it stopped revolving. the door slammed onto the face of guy behind me who was passing through the door too.
nothing is impossible..
|
|
|
|
|
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Have you ever looked at the PCL output from Word? You don't see complete words all the time. You see the PCL doing adjustments in the Horz direction with certain characters. Why is it doing that? Could it be that it is adjusting the Horz position due to the printer? Could it be that it is doing it because of the font? How is it deciding when to do the adjustment?
Fonts are driving me nuts! When I use the CRichEditCtrl’s FormatRange, it puts out a single string. I create a text box in Word, put the same text in and I notice that it breaks it up. Now I’m wondering why?
[EDIT]
AND, it doesn't look the same! The printed lenght (in inches) are not the same but have the same characters exactly! WHY? <- Pulling hair out!
[END EDIT]
I really do need some insight in outputting fonts to the printer. Something is going on that I’m in the dark about and I need some help big time!
Thanks to any who respond.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
It might well be that the PCL spit out by Word reflects the way that they are adjusting intercharacter spacing to improve kerning in a word, and in some cases for things like text justification, this is practically mandatory. If you want to know much much more about fonts, printing, and the rest of the GDI stuff, get yourself a copy of the Feng Yuan GDI book. It's worth every penny(or other currency of your choice).
I contracted at Serif once upon a while, and we used info like the ABC tables from fonts to alter output, and it really does make a difference.
Steve S
|
|
|
|