|
It's ok, it's part of the WinSock system.
When you call WSAStartup it does a bunch of stuff, create pipes, initialize structures, create monitor thread.
I would expect it to go away when you call WSACleanup.
There is a port of WinSock, with source, as part of Wine (? i think).
If you look at their source you will see what the other thread is/can be used for.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I cannot remove a blank directory in Windows 2000 using RemoveDirectory whilst I can do the same with same code in windows 98 - Please Help
boby
|
|
|
|
|
removedirectory surely works in 2000. check what's the error occured while removedirectory() thru getlasterror(). for details refer MSDN. otherwise you can try _rmdir() function.
Murali.M
there is always one more bug.........
|
|
|
|
|
bochan wrote:
how a
Here! Another one for you! But probably :grass: would be more appropriate?!
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
//A.h
Class A
{
A(int i, int j);
int GetIJ();
int K,L;
}
//A.cpp
{
A::A(int i, int j)
{
K=i;
L=j;
}
A::GetIJ()
{
int M=K+L;
return M;
}
}
//B.cpp
A *ATemp;
{
void B::FirstFunction()
{
int a=5;
int b=6;
A aTest(a,b); //Create a A Instance "aTest"
ATemp=&aTest; //assign aTest to ATemp
}
void B::SecondFunction()
{
int XYZ=ATemp->GetIJ();
//Is this correct? If this is wrong please tell me why
}
}
**************
Can I Create a Object in one function and using the object at another function?
|
|
|
|
|
Not this way. You have created the object on the stack in the first function and so the object is destroyed when the function returns. Therefore, your pointer to this object is no longer valid outside the
scope of the first function. There are lots of ways to approach this
problem, but one is to return an object of type A by value from the first
function and assign it to another object of type A which is declared outside
the function. The best method depends on the cost of creating and assigning the object.
|
|
|
|
|
I need get a button in the system taskbar,now I have got a pointer of the taskbar,but I can't catch a specific button in this taskbar,Please help me,thanks.
|
|
|
|
|
How do I programatically add a "Direct Connection between to Computers" assigned to COM5 ?
Just start the "Add Modem Dialog" is not a solution for me.
WinExec("rundll32.exe shell32.dll,Control_RunDLL Modem.cpl,,add",1);
Adding a Phonebook entry to this device with RasEnumDevices and manipulate the entries for SLIP is no Problem.
|
|
|
|
|
I created a dialog without title bar,so it has not a combine button in system taskbar,I used "ModifyStyleEx" Func to add a button in taskbar,then I used "LoadIcon" and "SetIcon" add a icon to this dialog.
The Question occured: when I pressed "ALT"+"TAB" two keys,this Application icon show in window is a system icon!!The icon in taskbar is mine only!
Why??Thanks.
------------------------------------------------------
Jerry Wong
Http://www.alphastudio.org
MSN:hotalpha@hotmail.com
|
|
|
|
|
Even if your dialog does not have a title bar, still you should set the Icon property for that form, to a valid Icon object.
|
|
|
|
|
Do you have the proper permissions to do it? Win2000/XP requires permissions, whereas Win98 doesn't, so this is the most likely cause.
|
|
|
|
|
|
Hello ppl
following is the code snippet
if(!AfxSocketInit())
AfxMessageBox("Socket Init Error");
if(mysocket.Create(6000,SOCK_STREAM) == TRUE)
AfxMessageBox("Socket Created");
if(server.Create(3000,SOCK_STREAM) == TRUE)
AfxMessageBox("Server Socket Created");
if(server.Connect("172.16.65.122",6000) == TRUE)
AfxMessageBox("Connected to client");
else
{
int a = server.GetLastError();
AfxMessageBox((CString)a);
}
what i am trying to do here is that i need to connect to the same machine using socks for that reason i have created two sockets one that actually should act as a client and other as a server now both the sockets are created successfully but server is unable to connect to the client (remember client is the same machine as server) the error no that is returned is 3 and i dont know what it means please help me out i am a socket newbie
thanks
|
|
|
|
|
if i read well ur server is connecting to a client???
this is odd
try that the client connects to the server
the server must be listening to its socket
(look at Listen and Bind)
i recomand you to look for NDK on CP
anyway the error code 3 means "The system cannot find the path specified. ERROR_PATH_NOT_FOUND"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
i want to have a lable with arabic font but the studio does'nt support arabic fonts how could i have a lable or menue with arabic fonts?
|
|
|
|
|
|
Have you got "wWinMainCRTStartup" as your "Entry-point symbol" ("Output" category of "Link" tab on project settings dialog) ? I had some linker errors when first building for unicode and I found that fixed it.
|
|
|
|
|
I just got Visual C++ .NET tonight and I started messing around with it. I'm a java developer and have been kind of curious of the .NET I'm really stuck i've search google.com but the word .NET brings up alot of junk. I'm stuck on declaring a function not sure how. I keep getting an error (error C3602: 'String': a __gc type object cannot be passed by value) It's right when I pass it to the function that will make the string to uppercase. Not sure what it means a __gc could someone help me out or show me where i can look at some online docs for newbies thanks.
<br />
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)<br />
{ <br />
this->label1->Text = this->textBox1->Text;<br />
this->strBox = this->textBox1->Text;<br />
this->upperCase = this->makeUpperCase(strBox); <br />
this->daString(upperCase);<br />
}<br />
<br />
public: System::Void daString(System::String * blah)<br />
{<br />
MessageBox::Show(blah,S"Testing Function daString", MessageBoxButtons::OK, MessageBoxIcon::Information);<br />
}<br />
<br />
String makeUpperCase(System::String * upper)<br />
{<br />
return upper->ToUpper();<br />
}<br />
<br />
private: System::Void Form1_Load(System::Object * sender, System::EventArgs * e)<br />
{<br />
MessageBox::Show(S"Message Box Demo",S"My Application", MessageBoxButtons::OK, MessageBoxIcon::Asterisk);<br />
}<br />
<br />
};<br />
}<br />
<br />
<br />
|
|
|
|
|
If you look closely, the String::ToUpper function returns a String*, whereas you are using a String return type.
Try
String* makeUpperCase( String* inString )
{
return inString->ToUpper();
}
There are minor differences between C++ and C++ .Net. C++ .Net compiles to MSIL code, and it has introduced the concept of garbage-collectable (__gc) classes. Since System::String is a __gc class, and not a value type like an int, so you can only use pointers to it in your code.
|
|
|
|
|
As an accomplished Java programmer you should consider C# as an option. You would have a much easier time learning it than managed C++. But everything depends on what you want to do.
Lorenz Prem
Microsoft Corporation
|
|
|
|
|
Hi all,
Need some help with an MFC dll I have.
I'm connecting/disconnecting to a database using two simple functions.
__declspec(dllexport) void Connect()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
database.Open( "EmployeeManager" );
}
__declspec(dllexport) void Disconnect()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
database.Close();
}
database is declared as global so I can access it all through the dll.
The problem is coming when I exit from the program using the dll. It throws a memory exception. I can't figure out why. I know its a problem with the connection because I tested just opening and connecting, then quitting and the error only occurs if I'm connected. I get an error regardless of whether or not I call disconnect on exit. Any ideas?
Mike
|
|
|
|
|
Did some more testing. The actual error I'm getting is "Exception Breakpoint A breakpoint has been reached."
This occurs only in debug mode. The release has no errors. I can't find any breakpoints anywhere so I still have no idea what's going on in debug mode.
Mike
|
|
|
|
|
A breakpoint is reported to the debugger by raising a STATUS_BREAKPOINT exception, code 0x80000003. If the debugger is not expecting it (i.e. there is no breakpoint on that instruction), it will report the exception to the user.
The system's heap manager will generate such an exception if it discovers, on freeing a block, that the block has become corrupted. I suggest using the gflags utility to enable page granularity heap allocations, where the heap manager allocates two pages per heap allocation. The first page contains your allocated block (allocated at the end of the page), and the second page is marked no access. When you overflow a heap buffer, you get an immediate access violation at that point.
IIRC, the heap manager by default only does heap checking if the executable image has the DEBUG flag in the header. VC's linker adds the DEBUG flag for a debug build.
To set up gflags , run it as an administrator, enter the name of your executable in the 'Image File Name' box, then choose the 'Image File Options' radio button. Check the 'Enable page heap' box and click OK.
|
|
|
|
|
Ok I did that and it gave me an access violation. Doesn't really help me though. First off I'm not real good at debugging, so unless its an obvious problem, doing something like you suggested doesn't help me much.
It's still the same thing that's causing it. When I try disconnecting from a database from my dll. It really doesn't make any sense to me. It worked before when I opened and closed the database from within an exported function. Then I decided it was a waste of resources to open and close each time I wanted to access it. So I declared a global instance of a CDatabase class.
I connect once at program initialization and then call disconnect at close. Seemed pretty simple to me, but now its throwing an exception for no apparent reason. The only solution I can think of is to go back to the old way of opening and closing the DB each time I access it.
Mike
|
|
|
|
|
I found a simple bug in VS.NET 2003 for C++...
the following cout statement
cout << "tetete??(tete";
would print
tetete[tete
It appears that it translates ??( as a square bracket....
My regional settings are English (US) .Just wanted to share this.
take care
|
|
|
|