|
There is no class wizard in the .net series of visual studio, all is done in the property window (AFAIK )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
When I right click on a dialog ressource (edit control for example) I have a menu to "add a variable". This menu opens a wizard to generate codes for this control ("Welcome to the Add Member Variable Wizard ").
Benoit
|
|
|
|
|
I have downloaded and used:-
<big>simples.c - Simple TCP/UDP server using Winsock 1.1</big> Now I have built and run a Client and Server Win32 Console application using this sample using my data structure. But problem with using the same code in a worker thread of a MFC application.
The following line causes problems:-
char *interface= NULL;
It generates the following errors:-
c:\ExampleDlg.cpp(214): error C2332: 'struct' : missing tag name
c:\ExampleDlg.cpp(214): error C2011: '__unnamed' : 'enum' type redefinition
c:\ExampleDlg.cpp(214): warning C4518: '__unnamed ' : storage-class or type specifier(s) unexpected here; ignored
c:\ExampleDlg.cpp(214): error C2059: syntax error : '='
Whats the solution to this problem please anyone?
|
|
|
|
|
May be the download stuff itself got some bugs in !!!
May I know what you trying to do?
|
|
|
|
|
Just want to receive a packet of data from another application on another PC. So I will be the Server.
The Microsoft sample works fine (as a console application), but its when you try and use the code in an MFC application get these errors.
|
|
|
|
|
I use NDK from the link below,
http://www.codeproject.com/internet/ndk.asp?df=100&forumid=1156&exp=0&select=756975
it's just nice;P
|
|
|
|
|
Try looking at CAsyncSocket or CSocket. Also it would be better to make your thread a UI thread so that it can receive events on the socket. Also if you do it that way it is better to create the socket in each thread.
Take a look at Joseph Newcomer's website about threads and sockets.
[^]
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hi! I wanna implement a simple web client using winsock. It can connect to any kind of HTTP servers (such as Apahce on Linux, IIS,....etc).
I also hope I can limit the bandwidth for each connection. I check the document (MSDN) that WSAConnect() provide the parameter (LPQOS lpSQOS) which can specify some properties of QoS including Bandwidth limitation. I write my code as follows:
QOS clientQos;
FLOWSPEC flowspec_guaranteed = {13000,
1260,
13000,
QOS_NOT_SPECIFIED,
QOS_NOT_SPECIFIED,
SERVICETYPE_GUARANTEED,
340,
340};
void InitQos()
{
clientQos.SendingFlowspec = flowspec_guaranteed;
clientQos.ReceivingFlowspec = flowspec_guaranteed;
clientQos.ProviderSpecific.buf = NULL;
clientQos.ProviderSpecific.len = 0;
}
main()
{
SOCKET s;
........
WSADATA WSAData;
err = WSAStartup(MAKEWORD(2,2), &WSAData);
s =Socket(AF_INET, SOCK_STREAM, proto);
.............
WSASetLastError(0);
returnval = WSAConnect(s, (SOCKADDR *)&sin, sizeof(sin), NULL, NULL, &clientQos, NULL);
if (returnval == SOCKET_ERROR)
{
j=WSAGetLastError();
closesocket(s);
}
while(....)
{
Send(s,.....);
}
while(....)
{
Recv(s,.....);
}
closesocket(s);
}
However, My program still send and receive data as soon as possible with the server (Apache Server) and I didn't get any error at all. It seems there is no bandwidth limit at all. Is there something I miss? Or It actually doesn't work at all and I go in the wrong way? Thanks a lot!
|
|
|
|
|
QOS is designed to ensure a min amount of bandwidth for a channel, not a max.
What is the effect you are trying to achieve ?
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I have a data type from class CLine which is derived from a
CObject.
since this line will not compile:
extern "C" __declspec(dllexport)void LineSerialize(CArchive& ar, CLine* pLine)
I changed it to:
extern "C" __declspec(dllexport)void LineSerialize(CArchive& ar, CObject* pLine)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CLine* lLine;
lLine = (CLine*)(CObject*)pLine;
lLine->Serialize(ar);
}
but it does not look so elegant to me. is this OK?
Thanks a lot,
Odie
|
|
|
|
|
it looks ok.
You dont need to cast to CObject though
This line
lLine = (CLine*)(CObject*)pLine;
could be
lLine = (CLine*)pLine;
Off the top of my head I think Serialize is a virtual method of CObject so you dont need to cast at all. You could just have
extern "C" __declspec(dllexport)void LineSerialize(CArchive& ar, CObject* pLine)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
pLine->Serialize(ar);
}
|
|
|
|
|
Thanks for the quick
reply!
it did it!
|
|
|
|
|
BTW, if I change my select SQL to say something like :
select cast(rawFIX as varchar(4000)) as "rawFIX"
the Open(...) does not raise an exception ....
|
|
|
|
|
MSDN says:The STN_CLICKED notification message is sent when the user clicks a static control that has the SS_NOTIFY style.
Now I add a static control in a dialog box,and I set SS_NOTIFY style.I want to ask whether the STN_CLICKED message is sent or not when I click the static control.I define a function——OnClicked(),which is used to handle with the STN_CLICKED message.But the function is not transfered when I clicked the static control.Why? I need your help.
|
|
|
|
|
How are you trying to catch that notification message? Notifications like BTN_CLICKED and STN_CLICKED are not sent as "normal" Window messages, but contained in the parameters for the WM_COMMAND message.
You should be looking for WM_COMMAND messages, and checking its parameters for the notification you are interested in. Of course, if you are using MFC, just use ClassWizard.
One small note. The STATIC control was not really designed to receive input, so make sure you are not doing something with it that it was not really designed for. (For example, creating a hyperlink control.) If you need imput, use an input control.
Peace!
-=- James 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! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hello Friends,
Can anybody suggest me some web sites for Unix tutorials. Programming C and C++ in unix operating systems.
Thanks in advance
Neelesh K J Jain.
|
|
|
|
|
|
Hi!
I'm having trouble with my MFC mapeditor. When I load a file the application changes the path to the directory the loaded file was in. How do i change it back?
I have my maps in maps/ and then I have a file called objects.ini in my basedirecotry. But if I load a map i can't do something like: fstream file("objects.ini").
Thanks for your help
|
|
|
|
|
It's usually never a good idea to use a relative path. Use an absolute path and you'll always be safe.
"Ideas are a dime a dozen. People who put them into action are priceless. - Unknown
|
|
|
|
|
if you are facing this problem with CFileDialog. Use OFN_NOCHANGEDIR flag in the cunstructor paramater of CFileDialog.
suhredayan There is no spoon.
|
|
|
|
|
I am having trouble Opening a CRecordset whose SQL select stmt returns a text column.
When the m_rs_data.Open(...) executes, the method triggers an exception that returns "Data truncated" in a text box.
Can anyone tell me how to properly fetch a row from my dB when the table includes a TEXT column?
Any help would be most appreciated.
Here's the code (some details left out)
CDBInstance *dbInstance<br />
CString sql = "select UID,XId,MsgSeqNum,Time,Dirctn,BeginString,SenderCompId,TargetCompId,OnBehalfOfCompId,DeliverToCompId,SenderSubId,TargetSubId,OnBehalfOfSubId,DeliverToSubId,Sender_C,Receiver_C,MsgType,TransactTime,<br />
rawFIX,CreateDate from TxAudit.dbo.AuditLog "<br />
<br />
CRecordset m_rs_data(dbInstance);<br />
<br />
m_rs_data.Open(selectSQL<br />
, CRecordset::dynaset<br />
, CRecordset::none);<br />
|
|
|
|
|
This error occurs when any of the data exchange field is smaller than their corresponding column in the database. A common chance is when any database column has a varchar field greater than 255 in size and the RFX_Text() function is called with default value of 255 for nMaxLength parameter.
suhredayan There is no spoon.
|
|
|
|
|
Is there a method I can call that will change this default value? Or some way to override the default, say, when I construct CRecordset??
I'm actually using a class (CODBCRecordset) that's wrapped around CRecordset. The only method I call is CRecordset::Open(...) ....
Link to CODBCRecordset
http://www.codeproject.com/database/parameterodbc.asp
|
|
|
|
|
BTW, if I change my select SQL to say something like :
select cast(rawFIX as varchar(4000)) as "rawFIX"
the Open(...) does not raise an exception ....
|
|
|
|
|
Hi,
I have a dialog with a ListBox Control. I want to map it, using ClassWizard to CCheckListBox but ClassWizard only let me to map it to CListBox. How can I set ClassWizard so I would be able to choose CCheckListBox.
thanks,
yaron.
|
|
|
|