CAsyncSocket clienSocket; clienSocket.Create(8001);//or any integer clienSocket.Connect(8000); execute this code on a click event of a dialog box then the onAccept of server will get executed automatically. its better derive to 2 different classes from CAsyncSocket as CMyClientSocket and CMyServerSocket instead of directly using the object of CAsyncSocket. never say die
sam India
Posts
-
CAsyncSocket serverSocket; -
Newbie needs help with DiaLogs and drop down menus...you can create wizard for this. you will have to use CPropertySheet and CPropertyPage classes. Search for msdn "Creating Wizards" in msdn. For menu cmenu mymenu mynenu.cratepopmenu() mymenu.appendmenu() mymenu.trackpopmenu(); you will have to use these theree functions. in appendmenu function, third parameter is a name of menu item, which can read it from a file using CStdioFile class never say die
-
msigetproductcodei wish to show user-name and product code in the about dialog box. the function used for this task is msigetproductcode() and msigetproductinfo(), could you please tell me, exactly what parameters should i pass into the function. the prototype is UINT MsiGetProductCode( LPCTSTR szComponent, LPTSTR lpProductBuf ); what does this szComponent refer to and what value should i pass. never say die
-
CRecordset, ODBC, and Accessafter update you are requerying and setting the bookmark. this is wrong. you can get bookmark of a current record after you update. and bookmarks are valid only for navigating in the current recordsets. once you close and reopen or requery then the bookmarks get vanished. you should call recordset.canbookmark() to check whether it is possible to bookmark or not. use CDatabase::GetBookmarkPersistence. always use exception handling in database programming to get the actual cause of erro. never say die
-
quick questionCreate the dialog box in Document class. if var1 and var2 are 2 variables of document class to be used by dialog class. if var3 and var4 are variables of dialog box class. CMyDoc::MyFunc() { CMyDialog Mydlg; Mydlg.var3 = var1; Mydlg.var4 = var2; if(Mydlg.DoModal()= IDOK) { var1 = Mydlg.var3; var2 = Mydlg.var4; } } never say die
-
VC Debug troubleit generally happens when you pass the function call as a parameter to some other function. for instance outer_func(inner_func()); when the control reaches on this line and you press F11 the control enters the source code for inner_func(), but if inner_func() doesn't return a correct value then the control won't enter the source code for outer_func(). never say die
-
I really need help here! guru plz helpaccording to me, you can solve the problem by creating a DLL project which has a fuction MyFunc() returning application object's address. Include this Dll in your addin and call MyFunc(). never say die
-
I really need help here! guru plz helpCWinApp* pApp = AfxGetApp();CString szWorkspace;//POSITION posdt = pApp->GetFirstDocTemplatePosition();POSITION posdt = ((CBackITUp_AddinApp*)pApp)->GetFirstDocTemplatePosition(); this code runs well when i executed it in newly created project. i executed this code in CMainFrame class message handler function. i suggest you to try this code in CMainFrame Class for testing purpose only the problem could be in base class of CCommons class, you haven't mentioned anything about its base class. never say die
-
I really need help here! guru plz helpyou are getting Null value returned by pApp->GetFirstDocTemplatePosition() bcoz you are using the base class pointer, and the base class pointer in not aware your projects Doc Template positions. If you type cast it into your project's application class, it won't return null value; CWinApp* pApp = AfxGetApp(); CString szWorkspace; ((MyPrjApp*)pApp)->GetFirstDocTemplatePosition(); never say die
-
Change button browse orderyou can choose tab order from the layou menu, to order the flow of control. the button which you wish to get pressed on pressing enter key, set the button as default in its properties. never say die
-
Spinbox Set long for rangeyou can use the function SetRange32 to increase the range of your spin control. kindly deselect "No thousands" check box in the spin control properties dialog. CSpinButtonCtrl *pCtrl = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN); pCtrl->SetRange32(lower limit,upper limit); never say die