|
Hi
I have some memory leaks in my application.
I found the functions which gives me memory dumps. I use _CrtDumpMemoryLeaks() function but it gives output on standard console...Where as I want it in one text file. Can any one help me how to do that....
Regards
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Hello
I want to make a wizard like the once in Access where we can find the path and select a database then the table and then the fields we want to work with..Is it possible?
Like is there any kinda ActiveX controll or some software I really would like to know..So if you know please tell me..
Thank you very much..
Have a nice day!
|
|
|
|
|
Right here...
http://www.codeproject.com/property/simplepropertywizard.asp
|
|
|
|
|
I have created 2 sockets .
I fr my server application <192.168.2.20> port 80
I fr my client. IP Address assigned: 192.168.0.51 port 80
Both The applications reside on the same machine.
When I execute the server it runs fine
But when I run the Client , it shows error code : 10047
Yeah, After surfing the net I got to know that Protocol family not supported ...
But the problem iz........
Unless the Connection is not established between the two applications
how come it give such error.
What Can there be other possibilities?
The portion causing error is Enclosed.
With hope to recv earliest suggestions i Thnx in Advance.
int main()<br />
{<br />
::<br />
::<br />
sock_creation();<br />
::<br />
::<br />
}<br />
<br />
int sock_creation()<br />
{<br />
int rc,k;<br />
struct sockaddr_in addr;<br />
char *servername;<br />
struct WSAData wsaData;<br />
printf("\n Count 10 n Resume ...\n");<br />
int wsaret=WSAStartup(0x101,&wsaData);<br />
if(wsaret<0) <br />
{<br />
printf("Unable to Initialize Windows Socket Library");<br />
k=getch();<br />
exit(1);<br />
}<br />
<br />
else <br />
{<br />
printf("\n Initialized Windows Socket Library");<br />
<br />
}<br />
<br />
<br />
conn=socket(AF_INET,SOCK_STREAM,0);<br />
servAddr.sin_addr.s_addr=inet_addr("192.168.0.51");<br />
servAddr.sin_port=htons(u_short(8080));<br />
<br />
<br />
if(conn==INVALID_SOCKET)<br />
{<br />
printf("\n But Unable to Initialize Windows Socket");<br />
k=getch();<br />
exit(1);<br />
}<br />
else <br />
{<br />
printf(" \n Initialized Windows Socket As Well.....");<br />
<br />
}<br />
if(bind(conn,(sockaddr*)&servAddr,sizeof(servAddr))!=0)<br />
{<br />
printf("\n But Failed to bind !!! Error Code %d\n ",WSAGetLastError());<br />
k=getch();<br />
exit(1);<br />
}<br />
<br />
<br />
servAddrSrvr.sin_addr.s_addr=inet_addr("192.168.0.20");<br />
servAddrSrvr.sin_family=AF_INET;<br />
servAddrSrvr.sin_port=htons(80);<br />
<br />
return 0;<br />
}<br />
amit mishra
|
|
|
|
|
Seems you are trying to bind the client socket also at port 80 which is not necessary .You can not bind two sockets on a same port ( exceptions are there but you wont need it )
So do this way ...Create a server socket , bind it to port 80 of you IP and make it listen for incomin connections . Next create a client socket . *Dont* bind it toany port (or bind it to non-80 port ) and connect toserver at 80 ...
Dharani Babu S
redindian
|
|
|
|
|
Thnx fr guiding me . This being my fst attempt in socket prg.
Yeah i cud move ahead all bcoz of u , but caught again midway.
In my server program when i use recv() it gives the failed to bind and failed to listen errors. When i m trying to print the acceptance after the accept function it shows the connection. That <client ip="" address="" is="" connected="">
On other side When i use recv fn in Client application some garbage is printed in . I use it like
<br />
{<br />
<br />
char buff[512];<br />
servAddrSrvr.sin_addr.s_addr=inet_addr("192.168.0.20");<br />
servAddrSrvr.sin_family=AF_INET;<br />
servAddrSrvr.sin_port=htons(80);<br />
connect(conn,(struct sockaddr*)&servAddrSrvr,sizeof(servAddrSrvr));<br />
recv(conn,buff,sizeof(buff),0);<br />
printf("%s\n",buff);<br />
}<br />
Can u say me where i went wrong.
amit mishra
|
|
|
|
|
You're ignoring the length of received data (returned by recv() ), you're not checking if all data is read in a single call to recv() and you're assuming that the data placed in buf by recv() is zero-terminated.
|
|
|
|
|
Hi all! I am Alex and wanna get help for how to Open the binary data file in C++ through the code. Actualy, the information in these data files are in hexadecimal forms, so I wanna ask how to use code to convert hexadecimal number to decimal number!
Weclome for all help!
Thank you very much!
Alex
|
|
|
|
|
Alex Wong 19 wrote:
...how to Open the binary data file in C++ through the code.
I would suggest CFile for this.
Alex Wong 19 wrote:
...how to use code to convert hexadecimal number to decimal number!
This is limited information, but my first inclination would be to use strtoul() . This assumes you would be reading the data in as a string.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi world,
I'm want limiting a folder size. My application create some files inside this folder but I don't want exceed the desired size. Thus this application must delete older files when I want to add new file (to always respect the size limitation).
Anybody have an idea to do that?
Thank in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
U may monitor that specified folder
ReadDirectoryChangesW is the API
it gives u many notifications (including size change, files added etc)
I hope this will help u
|
|
|
|
|
Rather than handle this at the software level, why not use quotas offered by the OS?
If you must attack this via software, a rough example is located here. It's specific to cookies, but you can alter the code as necessary to clean out old files.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello everyone,
I am using an MFC dialog based application where a gif is loaded into the dialog. Now, the problem is that some of the controls within the dialog become hidden by the image.
What I want to do is to place the controls infront of the image as a background. Can anyone guide me.
Thanx in advance
|
|
|
|
|
Call SetWindowPos(wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) to all hidden controls.
Robert-Antonio
"It's a good luck, when you meet a real fink. Then you get a respect to
normal, mid-honest people."
|
|
|
|
|
is this one able to replace IAMMultiMediaStream::open file?
i want a sample of using it.
who can do me a favor?
|
|
|
|
|
I have an editor applications which should bring up a window or dialog with the list of keywords. Based on the selected keyword the window should show the appropriate controls in the window. Filling up input into these controls and clicking insert the keyword should get inserted into the editor.
PLease someone help with some ideas on this.
|
|
|
|
|
The simplest approach is, that you create all controls in Dialog editor. In OnInitDialog you parse the keywords and set CWnd::ModifyStyle(WS_VISIBLE, 0, 0) to appropriate controls. This function makes the controls invisible.
Robert-Antonio
"Love without sex is like a fish without antlers"
|
|
|
|
|
also, I would put each set into a vector collection so that for each collection you can use the iterator to iterate through each one and set the visibility appropriately.
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
I have seen some code recently in the Unreal Tournament public source code that uses types like "void(UObject::*Func)( FFrame& TheStack, RESULT_DECL );" and I am trying to figure out how to use this in my own code. I have written something like below but I always get the error "C2064: term does not evaluate to a function"
class A<br />
{<br />
public:<br />
void TestFunc()<br />
{<br />
printf("Hello\n");<br />
}<br />
};<br />
<br />
void Test(void(A::*Prm1)(void))<br />
{<br />
Prm1();<br />
}<br />
<br />
int main(int argc, char **argv)<br />
{<br />
Test(A::TestFunc);<br />
<br />
return 0;<br />
}
It won't even let me cast it to a DWORD or any other types but you must be able to do something with it or it would not exist. So is there anyone here who can tell me how to use this (I dont even know what to call it), I have tried searching but all the search engines that I have tried have problems with "::*".
|
|
|
|
|
Try this:
class A
{
public:
void f() { printf("Hello\n"); }
};
void Test(void (A::*fun)(void))
{
A a;
(a.*fun)();
};
void main()
{
Test(&A::f);
}
If you call a non-static function via pointer-to-member, you have to specify a instance of class, that is passed to the member function.
Robert-Antonio
"Love, truth and electric traction must gain victory over hate, lie and
diesel traction."
|
|
|
|
|
Thanks alot, thats what I needed.
|
|
|
|
|
Hi,
I am writing an application that can do the following
1. Start an application
2. Open up a dialog box in the application
3. Write a message into a text dialog box and commit it.
I am having a problem with step 3. How do I pass along a string to write to a dialog box that is in focus. If this question has already been asked before, can you send me a pointer? Thanks.
Lohith
|
|
|
|
|
that means u wnat to update the edit box with some string?
ALL THINGS ARE POSSIBLE UNTIL THEY ARE PROVED IMPOSSIBLE-AND EVEN THE IMPOSSIBLE MAY ONLY BE SO,AS OF NOW
|
|
|
|
|
Get window handle of the text box and use SetWindowText.
Then send dialog a command message for the OK button press.
|
|
|
|
|
hi all,i have a problem with suspending a process.
Could someone help me?
Thanks a lot!
|
|
|
|