|
|
I have created separate thread for multiple clients.
In that case also connection failed from more than one client
|
|
|
|
|
It looks like your server is not keeping the wait for the next client. Can you show your server code ? that waits for the next client?
|
|
|
|
|
In server I have derived class from CAsyncSocket and had overrided OnAccept function
I am creating new thread from OnAccept function and wrote send,recieve functionalities inside the thread procedure.I have not added wait in server because OnAccept will be invoked when client tries to connect.
Can u please mention what is the problem??
|
|
|
|
|
Haven't used MFC for sockets sorry.
|
|
|
|
|
Is it possible with winsockets?
|
|
|
|
|
Hi, i have a small problem i have a csharp dll built in VS2005.I have to access the functions from this dll in my VC++ project done in VC 6.0.My VC project is not able to identify my C# namespace and class.I dont get what the problem is. Please do have a look at my c# code and VC Project code and do let me know if im making some mistake.I have also pasted the errors that i am getting. please do help me...i'm not able to understand the problem.
C# code:
using System;
using System.Collections.Generic;
using System.Text;
namespace TestDllCsharp
{
public class Class1
{
public void PrintMessage ()
{
System.Windows.Forms.MessageBox.Show("Test");
}
}
}
VC Project :
#import "TestDllCsharp.tlb"
using namespace TestDllCsharp;
#include <stdio.h>
void main()
{
HRESULT hresult;
CLSID clsid;
CoInitialize(NULL);
hresult=CLSIDFromProgID(OLESTR("TestDllCsharp.Class1"),&clsid);
if (hresult == 0)
{
_Class1 *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_Class1),(LPVOID *) &t);
t->PrintMessage ();
CoUninitialize();
}
}
I get errors like :
error C2065: '_Class1' : undeclared identifier
error C2065: 't' : undeclared identifier
Thnx in advance.
|
|
|
|
|
You cannot directly access a C# class in VC.
You will need to create a COM Callable Wrapper (CCW) from the C# class.
Look at the documentation on how to create CCWs.
Then you can access it from VC like you access a COM component.
«_Superman_»
|
|
|
|
|
Shouldn't that be Class1 instead of _Class1?
|
|
|
|
|
Hello Friends i am facing a problem of CString Memory Leaks in VC6.0 in the Release mode i need some patches to ovvercome the Error. How to Fix The Bug Without changing my application
Hi this Ravinder
|
|
|
|
|
Neither here nor the other time you asked this question have you given any objective evidence of why you believe there to be leaks in CString . As I stated before, look at your own code - the likelihood of your code being incorrect is much, much higher than the likelihood of the code in MFC being incorrect, especially when it's a version of MFC that's had 11-12 years of exposure.
|
|
|
|
|
I am new to VC++(MFC).. i'm in need to do a project in VC++ 2005 in MFC(MDI).... Our project is a stand alone project with runtime updation of databases also..,Can anyone help me in how to create forms with controls and calling one anotherforms..? I searched in Google .,no use.,help me please..........
Rajesh Kumar
|
|
|
|
|
How much are you ready to pay?
rajesh_kumar wrote: Can anyone help me in how to create forms with controls and calling one anotherforms
yes, good books or specific questions.
rajesh_kumar wrote: I searched in Google .,no us
And you didn't find anything.... READ MSDN
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
thank u..... for ur kind help.......!!!!!!
|
|
|
|
|
why don't you try Code Project Desktop Environment Section? you will get very good examples.
All the best
|
|
|
|
|
|
I am new to visual C++ and now i am working in a project of assessment tool. I want to generate dynamic controls like text box, combo box, static text dynamically. Can any one help me out from this?
|
|
|
|
|
The API to do this is CreateWindow .
The first parameter is a class name.
The class name can be a user defined class name or predefined class names.
Predefined class names like EDIT, COMBOBOX, STATIC, BUTTON etc. exist to create the standard controls.
Please refer to the documentation of CreateWindow for more details.
«_Superman_»
|
|
|
|
|
karthik11k wrote: . I want to generate dynamic controls like text box, combo box, static text dynamically.
What kind of application is yours? (Dialog/SDI/MDI using MFC or simple Win32 App)
If you are using MFC, create a member variable of CEdit, CComboBox, CStatic, etc. And in the OnInitDialog (in dialog based) you can create them using Create().
In the case win32 app, you can use CreateWindow with specific class name.
See this[^]
- ns ami -
|
|
|
|
|
i am working in a project in mdi using mfc vc++ 2005
i want to create that controls dynamically according to end user's wish. for an example, when the end user need a text box, then dynamically a text box should come in that form
|
|
|
|
|
karthik11k wrote: project in mdi using mfc
So MFC classes CEdit, CComboBox, etc. can be used.
karthik11k wrote: want to create that controls dynamically according to end user's wish
You can think about a linked list to keep the control objects. Check the MFC's CPtrList class. You need to create the controls (using new) and keep them in the list. And once you finished using them "delete" it.
- ns ami -
|
|
|
|
|
I got that Tahnk you I try to implement it.
|
|
|
|
|
karthik11k wrote: I try to implement it.
Good luck...
- ns ami -
|
|
|
|
|
Hi everyone...
Is there any way to refresh the console output black screen....Since I am using multiple thread to update the output window, my output is not reflecting immediately after I call cout.....
Thanks in advance..
I am a learner Always
|
|
|
|
|
himangshuS wrote: my output is not reflecting immediately after I call cout
Use cout.flush()
- ns ami -
|
|
|
|