|
Sorry to interupt you,it is said that two programs in different computer can communicate by named piped in the book of Programming Application For Windows,
can you tell me the details?
thanks a lot
|
|
|
|
|
yingkou wrote:
can you tell me the details?
Apart from the book, a good source is MSDN.
Also, Google can be a great help.
Bikram Singh
I believe we should all pay our tax with a smile. I tried - but they wanted cash.
|
|
|
|
|
I have a problem to use a DLL done in Vfp 8 with a code in VC++.
The source codes is below.
The message-> Warning: attempt to call Invoke with NULL m_lpDispatch!
is showed when the canal.processar routine is called.
Somebody can help me????
PauloTharso
ptharso@hotmail.com
***********************teleway.cpp -----------------------------------------------------
#include "stdafx.h"
#include "Teleway.h"
#include "canalfoxdll.h" // Added by ClassView
#include "k3l.h" // Added by Paulo
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CWinApp theApp; // The one and only application object
using namespace std;
Icanalfoxsrv canal; byte Info[20]; int key;
int32 Kstdcall Processador ( int32 Obj, K3L_EVENT *E ){ cout << "Processando eventos\n";
if (E->ObjectId == koiChannel || E->ObjectId == koiPlayer){
memcpy(Info,(char *)E + 28,E->ParamSize);
key = canal.processar(E->DeviceId,E->ObjectId,E->Code,E->AddInfo,E->ParamSize,(const char *)Info); // chamafox
if(!key) cout << "OK!"; else cout << "Falha no canal: " << E->ObjectId << endl;
}
return TRUE;
}
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; int check=FALSE;
Icanalfoxsrv * canal = new Icanalfoxsrv;
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)){
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}else{
CString strHello; strHello.LoadString(IDS_HELLO);
cout << (LPCTSTR)strHello << endl;
if (check!=TRUE) { char *Ret = k3lStart();
if (!Ret || !*Ret) k3lRegisterEventHandler( Processador );
check = TRUE;
}
// K3L_EVENT * wrk = new K3L_EVENT ; wrk->Code=1; wrk->ObjectId=1; wrk->ParamSize=8;
// Processador(2,wrk);
}
return nRetCode;
}
***********************canalfoxsrv.dll--------------------------------------------------
DEFINE CLASS canalfoxsrv as Session olepublic
PROCEDURE processar(p as Long,c as Long,e as Long,r as Long,l as Long,a as String ) as Integer
IF p<1 OR c>59 OR c<0 THEN
RETURN 1
ENDIF
INSERT INTO canalfoxtbl (placa,canal,evento,parametro,tamanho,adicional) VALUES (p,c,e,r,l,a)
RETURN 0
ENDPROC
PROCEDURE acionar(o as Long,c as Long, a as String @) as Integer
DECLARE INTEGER k3lSendCommand IN "K3LE1600" as Comandar STRING @
buffer=SPACE(50)
Comandar(@buffer)
RETURN 0
ENDPROC
PROCEDURE init
SET DEFAULT TO "c:\avisual\teleway"
SET DATE TO ANSI
ENDPROC
-----------------------------------------------------------------
|
|
|
|
|
i want to handle the situation when someone logs in to the system. how do i do so?
i know WM_ENDSESSION message is sent when the user logs out. but wat is the message when the user logs in....
|
|
|
|
|
Short of making your own msgina.dll, I know of no such message. Applications typically don't need to be notified when someone logs in, mainly because they probably aren't running. Services, however, might since they are running regardless of whether someone is logged in or not.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hey,
Can any one help me, how I can get Single Doc/View based application without menu bar? I don't want to switch to Dialog based application ......
Thanks for your help!
Suresh
|
|
|
|
|
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if(cs.hMenu!=NULL)
{
::DestroyMenu(cs.hMenu);
cs.hMenu = NULL;
}
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
Michael
CP Blog [^]
|
|
|
|
|
Got this! Thanks
|
|
|
|
|
I am using a standard algorithm coded from Visual C++.net
The heart of it is a formula I need to modifyfrom time to time.
As I need flexibility regarding this core formula, I would like to write it in an Excel cell, take the string via VBA and transfer it the heart of my C++ code in order modify calculation inside my algorithm.
It looks like an "uninteresting question" but solving that one could much simplify my daily life...
(How ) Is it possible to do that ?
Guillaume
|
|
|
|
|
Well you could expose a COM interface as part of your app that is consumable by VBA. That would probably be quite a load of work. Another approach would be to add interfacing with the Excel Object Model from within your app. While that would likely be much less work I cannot tell if it meets the needs of your use model.
Good luck
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Yesterday (or the day before, I can't remember )
I asked how to print a CString (with RTF codes)
Here's the basic solution.
create a 'dummy' CRichEditCtrl.
create a 'dummy' Window to contain this control.
set the RTF text in the CRichEditCtrl.
Print from there.
That's it (hope it's helpful to anybody)!
(PS: not possible to give the code, because it's to hard to strip)
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi,
I'm new in using windows sockets.
when I try to use windows sockets in my MFC application, I get the error "Could not start WinSock.DLL, error=0x276b".
in the InitInstance method, I have initialized winsock like this:
...
WSADATA ws;
if (!AfxSocketInit(&ws))
{
return FALSE;
}
...
event if I use the WSAStartup function, I get the messagebox error.
did I forgot to initialize something?
thanks for the help.
best regards.
There is no spoon.
|
|
|
|
|
I have not used AfxSocketInit but the the error it is reporting is
WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable.
So WSAStartup is failing in both cases.
This is only speculation but you do have a network card in your machine don't you?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi,
In fact, it's a problem of linking. when I link with ws2_32.lib and mswsock.lib instead of wsock32.lib , it works fine. so it seems that wsock32.lib does not work properly?
There is no spoon.
|
|
|
|
|
If you look at the documentation for WSAStartup it is defined in Winsock2.h and therefore you should link with Ws2_32.lib .
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Is it because you do not include link to
"Ws2_32.lib" ?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi,
I have exclude wsock32.lib and included ws2_32.lib in the link properties of the project and I don't get the error message.
But when I create a project that uses Visual C+ 6 with Windows Socket support (this project doesn't have any ws2_32.lib defined, it compiles and runs correctly, and when I create the same project with VS .NET 2003, I have the error I mentionned above Also a project like shareaza have no exclude libraries (like I have done)... it's maybe a problem of linking configuration.
There is no spoon.
|
|
|
|
|
Try not to be dependent on the wizard but do it manually instead.
The basic winsock initialization.
//initialize winsock
WSADATA wsaData;
int iRet=WSAStartup(0x101,&wsaData);
if(iRet)
return false;
SOCKET con;
con=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(con==INVALID_SOCKET)
return false;
//close connection
closesocket(con);
WSACleanup();
and include ws2_32.lib in the link.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I have done manual links with ws2_32.lib and mswsock.lib instead of wsock32.lib and manual initialization and it works just fine thanks
There is no spoon.
|
|
|
|
|
Hi
In MDI application,to manage the documents,i want to add "list of documents opened as tree items" how can i do this ?Here tree is in instant bar.if i click the tree item corresponding document should be open.
adwance thanks to those who help me.
-Mahatma
|
|
|
|
|
I play video capture and files using windowless mode in Direct Show.I'd like to show just the video images in the native video sized application window. How can I do this ? Also there is a problem first displaying the file. The captured video or files can not be shown until the main application window is dragged by mouse. How can I update the view in a Doc/view architecture ?
Sincerely
Cem DEMiRKIR
|
|
|
|
|
I have a small project that generates XML formatted text on a file. Simple. In my class i create an ofstream that I just stream static text but also text generated from an operation. E.g. m_OFS << "\t\t<OBJECT Name=\"" << WritePart1() << "\">" << endl;
The problem here is that the operation call is evaluated first, then the rest of the statement resulting in an output looking like this:
MyA00000Var <OBJECT Name="0012FE80">
How do get it in the correct order? Of course i can break up the statement into three parts, like:
m_OFS << "\t\t<OBJECT Name=\""; WritePart1(); m_OFS << "\">" << endl;
But I would like to stream everything in a row.
(I hope the html output will look ok)
modified 26-Oct-22 21:01pm.
|
|
|
|
|
Why not do this
std::string strWritePart = WritePart1();
m_OFS << "\t\t<object Name=\"" << strWritePart << "\">" << endl;
Assuming WritePart1 returns a string
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I can't use unicode on controls of VC++7. But as i known, VC++ 7 supported unicode. Who can advise me?
|
|
|
|