|
Hi!
I want know around Anti-Debugger Codes.
please help me!
Zo.Naderi-Iran
|
|
|
|
|
Before someone can answer this question, we need to know what "Anti-Debugger Codes" mesans!
INTP
Every thing is relative...
|
|
|
|
|
|
hello all
how to place bitmaps over the buttons using the property Setbitmap and getbitmap in vc++.
Thanks in advance
cheers
ramya
|
|
|
|
|
Declare a CBitmapButton control variable for the button and call the LoadBitmaps() method.
Set the OWNERDRAW property for the button.
Vini
|
|
|
|
|
|
hon can i get motherbord id and vedio card id and when i can find them
am
|
|
|
|
|
ss2006 wrote: hon can i get motherbord id and vedio card id and when i can find them
try WMI[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi All,
I have some queries to you people. It would be of great help if someone gives me answers for them.
1. what is the difference betn, structures in C++ and class in C++
2. what is the difference betn. structures in C and structures in C++
3. what is basically a mutable member
4. how do i call a C function from a C++ program. Do I need to use any keywordexplicitly?
Thanks In Advance
|
|
|
|
|
Subramaniam s.V. wrote: what is the difference betn, structures in C++ and class in C++
a structure in C++ IS a class, which default members are set to public instead of private .
Subramaniam s.V. wrote: what is the difference betn. structures in C and structures in C++
a structure in C is only a declaration of several types disposed contiguously, encapsulated within a name. in C++, a structure is a class, which mean that it can have all the classes enhancements, like member functions, constructors/Destructors, etc...
Subramaniam s.V. wrote: what is basically a mutable member
according to the MSDN[^], a mutable member can be modified by any function that can access it, even if the function is declared as const (a function declared as const is normally not allowed to change the class members).
Subramaniam s.V. wrote: how do i call a C function from a C++ program
you mean, withing the same project ?
just as you would have done in a C program...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
First this is a school question.
1) The difference is that a C++ class defaults to private and a structure defaults to public.
2) In C there are no member functions; a structure is just a set of data. That is it represents the equivalent of a record.
3) You are learning! A mutable member is a variable that can be changed at any time. You see there are member variables that may need to be changed, while giving the impression that nothing has changed, from the user point of view.
4) All I can say is YES, depending on the compiler and what you specify in your code.
INTP
Every thing is relative...
|
|
|
|
|
Is there an easy way to check available memory before / after using *p = new int[ ] ? I tried CMemoryState, without success.
|
|
|
|
|
I am not sure if there is a single function call that can give an answer to your question. This would have been a simple question before the advent of virtual memory, but that is no longer the case. If you want to know the physical memory available then you may have to experitment, but that limits you to the machine you are on. Write your programm in such a way that it can compensate for the lack of phisycal memory, or can inform the user if it can not.
I am just saying that we no longer know the amount of memery available and you have to make sure that if it is not, your progam catches that problem before it crashes some bodies machine.
INTP
Every thing is relative...
|
|
|
|
|
Thanks John, it´s clear that new returns 0 if allocation failed. I´m just looking for a way of checking available memory before and after such operations. Due to the dynamic memory model in windows it may be impossible to get exact required data. Purpose is not implemeting it in a commercial application but memory usage demonstration to students. In DOS times ( a century ago ) we had a similar function.
|
|
|
|
|
Have a look at the GlobalMemoryStatus() function.
Ryan "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"
|
|
|
|
|
I doubt it, since freed memory does not automatically go right back to the pool of available memory. Windows' memory manager is a very complex beast.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
pls give the code for getting Ip address of the computer using VC++
|
|
|
|
|
There are lots of examples here on CP about this topic, but here is some quick code:
WSADATA data;<br />
WSAStartup(MAKEWORD(2,2),&data);<br />
char szHostname[256];<br />
if (gethostname(szHostname, sizeof(szHostname)))<br />
{<br />
WSAGetLastError());<br />
}<br />
HOSTENT* pHostEnt = gethostbyname(szHostname);<br />
if (pHostEnt == NULL)<br />
{<br />
WSAGetLastError());<br />
}<br />
if (pHostEnt->h_length != 4)<br />
{<br />
}<br />
int nAdapter = 0;<br />
in_addr address;<br />
CopyMemory(&address.S_un.S_addr, pHostEnt->h_addr_list[nAdapter], pHostEnt->h_length);<br />
dwIP = MAKEIPADDRESS(address.S_un.S_un_b.s_b4, address.S_un.S_un_b.s_b3, address.S_un.S_un_b.s_b2, address.S_un.S_un_b.s_b1);
Now the address is in dwIP as a DWORD also.
Also available through the:
address.S_un.S_un_b.s_b1<br />
address.S_un.S_un_b.s_b2<br />
address.S_un.S_un_b.s_b3<br />
address.S_un.S_un_b.s_b4
as individual unsigned bytes.
this is this.
|
|
|
|
|
go thru this one.
char szHostName[128];
if( gethostname(szHostName, 128) == 0 )
{
// Get host adresses
struct hostent * pHost;
int i;
pHost = gethostbyname(szHostName);
for( i = 0; pHost!= NULL && pHost->h_addr_list[i]!= NULL; i++ )
{
CString str;
int j;
for( j = 0; j < pHost->h_length; j++ )
{
CString addr;
if( j > 0 )
str += ".";
addr.Format("%u", (unsigned int)((unsigned
char*)pHost->h_addr_list[i])[j]);
str += addr;
}
// str now contains one local IP address - do whatever you want to do with it (probably add it to a list)
}
}
viveks
|
|
|
|
|
mailsafe wrote: pls give the code for getting Ip address of the computer using VC++
Just a ?, Why you need IP address of a computer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Using App wizard i chose to create a MDI application. In such cases when we run the program the MDI will run first. But i want to insert a dialog eg a login dialog such that when we run the project the dialog should be displayed first. And on the button(which is placed in the dialog)-click, the MDI interface should open up. pls give a solution
-- modified at 4:43 Wednesday 1st March, 2006
|
|
|
|
|
So what have you done till now? Where are you doing this?
Nibu thomas
Software Developer
|
|
|
|
|
Hi,
I am trying to use an RTP code (.lib) i downloaded from the net. When I try to use the same code as a Win32 DLL the compiler doesnot identify the ntohl and other such functions in the Winsock2.h header. I can do without the socket calls as I have to use the RTP in a C# code and I can use sockets in C#, but ntohl etc. must be used.
Can some one tell me what could be the problem and how it can be fixed?.
I have tried searching the net and came across managed and unmanaged dll's etc. But I cannot even understand what they mean by it, bcoz I am creating (and using) DLL for the first time.
Thanks
castratroi
|
|
|
|
|
I have some code that was generating compile errors. I have found the solution to fix the problem, I'm just not 100% sure I understand what the problem actually is. The (much simplified)code below should help explain the issue. I have created a decendant object from ABC that contains the implementation of function FOO
<br />
<br />
<br />
class ABC<br />
{<br />
public:<br />
virtual void FOO(BAR& foo);<br />
};<br />
<br />
<br />
class ABC<br />
{<br />
public:<br />
virtual void FOO(BAR& foo) = 0;<br />
};<br />
My question is this,
What does the "= 0" indicate?
Why is it needed?
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
I think I have found the answer,
The "= 0" is to indicate to the c(++) compiler that this function is purely virtual and there is no implementation in the base class, which therefore cannot be instantiated directly (which is what I intended). Is this correct?
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|