|
Hi. I am having a problem running the 'dt_dll' of windows platform sdk under windows 2000 SP4. It comes with a replacement ws2_32.dll (winsock2) that makes possible to trace winsock calls.
The problem is that this replacement of ws2_32.dll calls GetModuleHandleExA in kernel32.dll, by kernel32.dll does not have this entry.
Anybody knows what is (version?) the problem ?
Thanks a lot.
Juan Carlos Franzoy
|
|
|
|
|
GetModuleHandleEx is only supported on Windows XP and higher, not on Windows 2000 (see here[^]).
Check, if there's a version of the ws2_32.dll replacement available for Windows 2000. If not, you'll need to develop/test it on a machine with Windows XP or higher.
|
|
|
|
|
I'm trying to delete a value inside a specific key. Whats wrong with the example code I've written to do this?
<br />
<br />
HKEY hkey;<br />
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Belkin\\Belkin 802.11g Wireless PCI Card\\1.0.0", 0, KEY_SET_VALUE , &hkey);<br />
RegDeleteValue(HKEY_LOCAL_MACHINE,"test");<br />
RegCloseKey(hkey);<br />
|
|
|
|
|
RegDeleteValue(hkey,"test");
|
|
|
|
|
arbster wrote: Whats wrong with the example code I've written to do this?
What's wrong is that you are not looking at any return values. Functions return a value for a reason.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
... and even wronger is the missing usage of _T() for string arguments.
"My god... we're all gonna die!
Control yourself, general."
|
|
|
|
|
Thats not wrong if you're not concerned with Unicode.
Steve
|
|
|
|
|
True, but is quite rare the code that escapes from Unicode today...
Nuclear launch detected
|
|
|
|
|
You opend your key so you must use of hkey on the RegDeleteValue
|
|
|
|
|
Hi All,
I have two ComboBox controls
{A(it has items like A1, A2 and A3)and
B (B has B1, B2 and B3)}
and one spin control (Z).
Now, my task is that when from control A, A1 is selected then full control B should be diabled. And for all others A2 and A3, B should get enabled.
This is how my code is:
m_CtrlA.SetCurSel(0);<br />
m_CtrlB.ResetContent();<br />
if (m_CtrlA.GetCurSel() == A1)<br />
{<br />
m_CtrlB.EnableWindow(FALSE); <br />
m_Spin.SetRange(0,1000); <br />
}<br />
<br />
else<br />
{<br />
m_CtrlB.EnableWindow(TRUE);<br />
}<br />
So, the problem is what this code is doing is that it is disabling the full m_CtrlB for every case. But I want to disable it for A1 only.
I would really appreciate if someone could help me.
Thanks a lot in advance
C++Prog
|
|
|
|
|
Assuming, A1 is of type int and it's value is 0, you should remove
m_CtrlA.SetCurSel(0); . because it sets the selection back to 0th item A1 and hence making the if condition useless.
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
In the if statement, A1 is used. What is A1 defined as?
m_CtrlA.SetCurSel(0);<br />
m_CtrlB.ResetContent();<br />
if (m_CtrlA.GetCurSel() == A1)
if it's not 0 then this will never be equal, because you set the current selection to 0 before the if statement is executed.
|
|
|
|
|
Thanks for the quick response.
A1 is define as:
#define A1 (0)
So, its value is Zero.
And yes I should get rid of
m_CtrlA.SetCurSel(0);
C++Prog
|
|
|
|
|
celllllllll wrote:
And yes I should get rid of
m_CtrlA.SetCurSel(0);
C++Prog
You should get rid of m_CtrlA.SetCurSel(0); and C++ Programming ? just kidding.
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
say a member function
void MyClass::memFx(int a)
{
int a;
a = 25
cout << "a: " << a << endl;
}
if I call the fx with parameter 5 what will display? what are the other rules of hiding variables? sorry i need your help as I have no compiler with me atm.
thx.
|
|
|
|
|
This would give a redefinition error since you have a already in the function parameter. But hiding variables? can you explain it better?
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
VuNic wrote: This would give a redefinition error since you have a already in the function parameter.
a small modification, and it will compile fine:
void memFx(int a)
{
{
int a;
a = 25;
cout << "a: " << a << endl ;
}
}
that's variable hiding. the 'a' inside the brackets hides the 'a' from the containing scope, and so the function always outputs 25.
inner scope hides outer scope.
i'm not sure what all the rules are, though.
|
|
|
|
|
"Variable hiding"- Just learnt. Thanks Chris.
:Gong: 歡迎光臨 吐 西批 :Gong:
|
|
|
|
|
Chris Losinger wrote: that's variable hiding. the 'a' inside the brackets hides the 'a' from the containing scope, and so the function always outputs 25.
inner scope hides outer scope.
So what exactly is the purpose of this part of the language? Or in what circumstance would it be used?
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
S Douglas wrote: Or in what circumstance would it be used?
i've always used it accidentally. i don't know why anyone would want to use it on-purpose.
|
|
|
|
|
Chris Losinger wrote: i don't know why anyone would want to use it on-purpose.
Out of curiosity, I tried it on a small routine I know gets called and it indeed compiles fine in VS2005 no warnings / errors and it definitely changes the flow. Wierd
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
I noticed when I open my (both debug&released) EXE in Res(ource)Hacker, it displays Icon, Menu, Dialog, String Table, Icon Group, and Version Info.
I compared this to several other EXE (not by me), and they only have Icon, Icon Group, and Version Info displayed.
Anybody knows how to prevent the user from using Resource Hacker to change the Menu/String Table?
Thanks in advance.
|
|
|
|
|
You can simply pack your executable using a tool like UPX[^].
Note that UPX is free, but it's possible to unpack the packed executables, i.e. it won't prevent hackers frm editing your resources. If you want to compress+protect your executable, you could try ASPack[^], but note that it's a commercial program.
|
|
|
|
|
Well, not every application uses dialog templates in resources to generate their interfaces, they can generate them dynamically (in memory). Same goes for menus. Also, not all applications use the String Table to store constant strings.
Generally, most applications use them. For example, if you open up Explorer.exe, you will get everything.
Also, note that applications generated by different languages/environments may or may not use resources like a MFC app. For example, a VB application I have handy only contains Icon and Version resources. VB Forms are not static Dialog templates, I guess.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Actually I want to print the buffer in minicom using debug_hex..but it gives error could u please let me know looks like error in debug_hex command..
buffer_send->buf[buffer_send->buf_end++]=0x01;
buffer_send->buf[buffer_send->buf_end++]=0x01;
buffer_send->buf[buffer_send->buf_end++]=0x01;
for(j=0,j<3;j++)
debug_hex(buffer_send[j])
thanks.
|
|
|
|