|
GlobalRealloc() does not necessarily return the same memory handle as the one passed to it - it's value may change. You need to store the new value:
eyeConClients[msg - SOCKET_ID - 1].buffer = GlobalReAlloc((HGLOBAL)eyeConClients[msg - SOCKET_ID - 1].buffer, szTemp, GMEM_MOVEABLE); If you need to cast your buffer to a HGLOBAL, you will need to cast the return value of GlobalRealloc() to make it fit with your buffer variable. You didn't say what type it was, so I don't know what to cast it to - you'll need to do that.
Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
what is the value and datatype of szTemp?
What amount of physical memory available at the moment of the error?
What is the page file size?
What is the error number?
|
|
|
|
|
Hello. I have a problem. I want to make autoplay cdrom function disable in windows. I don't know how do it. Can you help me? Thanks
welcome to meet you!
|
|
|
|
|
you need to change value of registry key
HKEY_CURRENT_USER\Software\Microsoft\Windows\
CurrentVersion\Policies\explorer\NoDriveTypeAutorun
to (DWORD) 0x0FF disable
or (DWORD) 0x095 enable autoplay
|
|
|
|
|
Just to supplement what skaanji said...
For the NoDriveTypeAutorun variable, each bit in the value represents a type of drive. A bit set to '1' disables autorun for that drive type, '0' enables it.
Bit 0 = Unknown drive types
Bit 1 = Drives without a root directory
Bit 2 = Removeable drives (floppy, zip, jazz, etc.)
Bit 3 = Fixed drives (hard drives)
Bit 4 = Network drives
Bit 5 = CD/DVD drives
Bit 6 = RAM drives
Bit 7 = Reserved (always set to 0)
Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Dear skaanji and Ryan Binns:
At first, Thanks a lot for you. You have said is correctly. But Because I have a little about register. So maybe it is difficult. Can you give me a example about it? I saw some about Enabling and Disabling AutoPlay articles in Microsoft MSDN. It's tittle is "Enabling and Disabling AutoPlay" . It seems that maybe have other method. Can you see the article for me. I am expecting...
welcome to meet you!
|
|
|
|
|
I don't think that there is any other way so you need to change the registry but this is what I use:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CDRom]
"Autorun"="0" // 0 disable, 1 enable
I also agree with the other posts that suggest that you should not change user settings unless you let them know what you're doing.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
It is a VERY BAD IDEA to change people's registry. Look in MSDN for "disable autoplay" and it tells you a way to do it while your program is running without changing people's registry.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
If this is your own computer I would change the registry however if this is a product you should not mess with the user settings in the registry unless you at least inform the user of what you are doing and allow them to cancel your change.
John
|
|
|
|
|
Hi, Sir:
I saw your answer about disable CDROM autoplay function . and I think so that It is a very bad idea to change people's registry. And I have sawn the "Enable and Disable AutoPlay" in MSDN. I do it that:
UINT g_uQueryCancelAutoPlay = 0;
BOOL DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
...
default:
if (!g_uQueryCancelAutoPlay)
{
g_uQueryCancelAutoPlay = RegisterWindowMessage(TEXT("QueryCancelAutoPlay"));
}
if (uMsg == g_uQueryCancelAutoPlay)
{
SetWindowLong(hDlg, DWL_MSGRESULT, TRUE);
return 1;
}
}
}
but I can't success. Can you tell me How to do it? I wish to get your reply? Thanks
|
|
|
|
|
Does anyone know how to change the standard view in the MDI project with a Property sheet (wizard style)?
|
|
|
|
|
You can find a class 'CPropertySheetView' here[^] at CP.
But I have no idea if it can be used as a Wizard.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
hi
Just declare a member variable of your propertysheet class in the view class, override OnInitialUpdate, create the member propertysheet as a child.
void CMdiView::OnInitialUpdate() <br />
{<br />
CView::OnInitialUpdate();<br />
<br />
CMySheet *m_pMySheet = new CMySheet("foooo");<br />
<br />
m_pMySheet->Create(this,WS_CHILD|WS_VISIBLE,0); <br />
<br />
}
best wishes..mil10
|
|
|
|
|
Hello I'm a beginner in VC++ and I have to realise a dialog based application with a tab control.. Unfortunately my books don't talk about that .. I check on the VC++/Tab Ctrl topic on the left menu but that's for advanced users (and that's advanced tab ctrl).. So can you give me a basic "how to" make easylly a tab ctrl. I would like make it tottaly to understand how it works...
Thx a lot
little french
|
|
|
|
|
Salut,
Regarde les CPropertyPage et les CPropertySheet, cela te permet de gérer un tabctrl.
Tu crées ton CPropertySheet et dedans tu mets autant de CPropertyPage que tu as besoin.
|
|
|
|
|
lol merci y a des francais ici aussi :p
Je vais voir sa de suite merci beaucoup.. vraiment merci
|
|
|
|
|
OK then
I guess you don't need any further help from the rest of us (english speakers).
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
RChin wrote:
I guess you don't need any further help from the rest of us (english speakers).
I think he was a bit surprised to see someone who knew French.
He said thankyou 3 times, each one more sincere than the previous , so I think he's OK
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
I think he was a bit surprised to see someone who knew French.
There's a whole country of 'em ... somewhere
Ryan Binns wrote:
He said thankyou 3 times, each one more sincere than the previous , so I think he's OK
Ahhh. OK.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
RChin wrote:
There's a whole country of 'em ... somewhere
I think it's over near that puny little country strangely called "Great" Britain
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hello,
Inside a formview, i've got the reader activex :
- Is it possible to remove some of the icons of the toolbar from the pdf.ocx in order to customize it ?
I've tried with the registry but i have always the entire toolbar.
- When i gave up this solution, i succeded to simulate the some of the standard icon (text capture, image capture ...) with windows messages.
That's fine on all the os but i have some problems on XP.
Sometimes it works and sometimes not, certaily a problem with the windows message due to XP ?
Anyone has an idea ?
Thanks.
|
|
|
|
|
You could try to get a window handle for the toolbar (use Spyxx to help you) and then send TB_DELETEBUTTON messages to delete specific buttons from the toobar. I can't guarantee that it will work, but it's most likely to.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
one problem when i'm doing find&replace in vs6.0 with regexp.. i can't get the quantifiers to get "nongreedy" (this term is from uwe keim's "introduction to regexp").
normally the letter "?" should work.. but not for me..
any ideas?
<br />
fun (char sz1[], char sz2[], char sz3[]);<br />
change to
<br />
fun (const char* sz1, const char* sz2, const char* sz3);<br />
<br />
Find: char \(.*\)\[\]<br />
Replace: const char *\1 <br />
is greedy..
<br />
find: char \(.*\)?\[\] <br />
or
<br />
Find: char \(.*\)\?\[\]<br />
don't work for me..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
The following regex worked for me (using VS7.0; VS6.0 may be different):
<br />
char {.@}\[\]
- Mike
|
|
|
|
|
Instead of \(.*\)\[\] use \([^[]*\)\[\] . This is the same except instead of matching any character, it matches non-'[' characters, thereby terminating when it reaches the '[' character.
Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|