|
What exactly do you mean by "get the information" ? You looking for any "Data" communication between the processes or just an event notification ?
|
|
|
|
|
Thnks for the reply..
i ll tell u the exact scenario..
i have an application(i.e. an access control system).. im asked to use tcp/ip to collect the data(i.e.. address of the card reader, time and violation code) from the application when there is access violation... and after getting the instance of access violation, im supposed to pass the information to another application(written in c++) to take an action(record the event from a cctv where it is happening)..
|
|
|
|
|
I'm again confused ! Anyway, if you wanna to pass data across the process [i'm supposed to pass the information to another application(written in c++)] you can choose any of the Inter Process Communication mechanism[^]. And if you just wanna to sent an event notification (like a signaling kind of thing) you can use synchronization [^] object like Event.
|
|
|
|
|
What do you need exactly? user name? computer name? hardware profile? processes? folders? hardware?....
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Thankq Hamid!!!
i have an application(i.e. an access control system).. im asked to use tcp/ip socket communication to interface. have to collect the information(device address where access violation takes place ,alarm id) from the application when there is access violation... and after getting the instance of access violation, im supposed to pass the information to another application(written in c++) to take an action(record the event from a cctv where it is happening)..
|
|
|
|
|
is there any written way to communicate or you have to create mechanism for this. could you please clear it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
For the receiving side there is a code , which accepts the information.. i have to simply pass the value from the access control system service to the to the code...
can i use client side programming to get the info from service ?
|
|
|
|
|
it there is any documented way to retrieve code from service or you have to device your own for it...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
yea there is a documented way.. if i give a command like this to the service"" <username password="******/>" i.e.="" mode="hold">
when a event occurs, then it ll send a command in the above said format.. i have to send the data from those command to another application .
i used client socket programming to send n receive the message., is there any way to get the data
wsprintf(Buffer, ""<username password="******/">", loopcount++);
iretval = send(c_socket, zBuffer, sizeof(zBuffer), 0);
if (retval == SOCKET_ERROR)
{
fprintf(stderr," send() failed: error %d.\n", WSAGetLastError());
WSACleanup();
return -1;
}
else
printf("send() is OK.\n");
printf(" Sent data \"%s\"\n", zBuffer);
modified on Tuesday, December 30, 2008 7:25 AM
|
|
|
|
|
Hi I have an application which protects and unprotects .doc file. If I protect file first it works fine but when I am unprotecting it with following code it unprotects properly but again if I am trying to protect it it gives error (File not in format i.e not structure storage file). Please let me know is anything wrong with following code.
COleVariant vFilename(csFile);
VARIANT vOptional;
vOptional.vt = VT_ERROR;
vOptional.scode = DISP_E_PARAMNOTFOUND;
int iStat = FILE_NOT_EXIST ;
// Now ole object specific processing
switch (iType)
{
case WINWORD:
{
pFile -> Dispatch -> AddRef();
_Document Doc;
Doc.AttachDispatch(pFile -> Dispatch);
// The actual save
Doc.SaveAs( vFilename,
&vOptional, // Format
&Optional, // LockComments
&Optional, // Password
&vOptional, // AddToRecentFiles
&vOptional, // WritePassword
&vOptional, // ReadOnlyRecommended
&vOptional, // EmbedTrueTypeFonts
&vOptional, // SaveNativePictureFormat
&vOptional, // SaveFormsData
&vOptional); // SaveAsAOCELetter
}
break;
}
Do I need to add / set some more variant variable in order to protect it in second time.
Thanks
SNI
SNI
|
|
|
|
|
<br />
...<br />
&vOptional,
&Optional,
&Optional,
&vOptional,
...<br />
Do you have two different variables vOptional and Optional?
|
|
|
|
|
no that is copy paste mistake. it it vOptional at each place.
SNI
|
|
|
|
|
|
I write a simple dll and inject to another process, i communicate with the target process by sending message via a named pipe. But now, the problem is that, although i can retrieve a top-level window of the target process,i will get no response if i send menu messages to it(the hwnd i retrieved, using EnumWindows, no matter i send the messages in the callback functions of EnumWindows or not, the results are the same). So, i think, the hwnd handle i retrieved was not the target hwnd handle witch was responsible to such activity.
But, how could i get the right hwnd to handle these menu messages?
Thanks
|
|
|
|
|
i will get no response if i send menu messages to it(the hwnd i retrieved, using EnumWindows, no matter i send the messages in the callback functions of EnumWindows or not, the results are the same)
Can you please post some code lines (sending menu messages) ?
|
|
|
|
|
I wrote enumwindows callback function like following:
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
DWORD procId;
GetWindowThreadProcessId(hwnd,&procId);
log_message("Main window search callback function is called.");
if(procId==(DWORD)lParam){
....the message would to be send here
return FALSE;
}
return TRUE;
}
I send the menu message in two ways:
1. HMENU trayMenu = GetMenu(hwnd);
if(trayMenu!=NULL){//usually equal to NULL, and according to the failure in method 2(send msg no response) i think i got the wrong hwnd handle
HMENU subMenu = GetSubMenu(trayMenu,0);
if(subMenu!=NULL){
DWORD menuItemId=GetMenuItemID(subMenu,0);
if(menuItemId!=-1)
SendMessage(hwnd,WM_COMMAND,menuItemId,0);
}
}
2.Because i can get the menu resource id, and, this code is implemented in a injected dll to the target process, so, there is a second method here:
HMENU trayMenu = LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDM_MENU));
if(trayMenu!=NULL){//successfully always
...the other code looks the same with the method 1, but the target process's specified routine will not be actived, because its no response.
|
|
|
|
|
Try to find out whether you are retrieving ID of the right menu item. Call GetMenuString() for that item and debug print it. If you send the message for menu item which consists of submenu, that won't help you (application doesn't display out the submenu as a result).
|
|
|
|
|
im sorry to reply so latter. i have gone to another city. and i know them problem now, i got the right menu, menuitems and menuIDs, but sent the menu message to a wrong hwnd. The program has more than one toplevel hwnd, so, i retieve all its top level hwnds and send menu message it them. then, when i got the right hwnd, the message would send successfully.
|
|
|
|
|
Hi All,
I am using the Windows API to enumerate the certificate installed in the 'MY' store. In this process, i am able to enumerate the certificates installed in the smart card also. I am looking for an API which would differentiate whether the certificate is within the samrt card container or in the machine itself.
Your time and help will be appreciated. Thanks in advance.
Sunil
|
|
|
|
|
Hello Frriends
"MSVCRT.lib(chkstk.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'"
This Linker error really frustrates me and i googling a lot but didnt find any relevant suggestion.Can Anybody suggests me here , how to overcome this error....
i am Trying to compile my project (that works fine for 32 bit) to make it compatible for 64-bit OS. For That I change the Setting as "Build -> Configuration Manager -> x64|Debug". I am using MS Vs2005(VC++)
...Sorry friends if ii make any silly mistake..
is there any other way to make a project 64 bit compatible.....
|
|
|
|
|
Do you have #include<iostream.h> in your code ? If yes, try #include<iostream> instead.
|
|
|
|
|
Thankx Malli!!
After Adding "iostream.h"
i got 42 errors as can u tell me what is it
Linking...
LINK : warning LNK4076: invalid incremental status file '.\Debug/eSLogOn.ilk'; linking nonincrementally
Creating library .\Debug/eSLogOn.lib and object .\Debug/eSLogOn.exp
eSLogOn.obj : error LNK2001: unresolved external symbol _RTC_Shutdown
GENERAL.obj : error LNK2001: unresolved external symbol _RTC_Shutdown
main.obj : error LNK2019: unresolved external symbol _RTC_Shutdown referenced in function "void __cdecl CreateScanLogoWindow(void)" (?CreateScanLogoWindow@@YAXXZ)
eSLogOn.obj : error LNK2001: unresolved external symbol _RTC_InitBase
GENERAL.obj : error LNK2019: unresolved external symbol _RTC_InitBase referenced in function Probe_GetFileAttributesEx
main.obj : error LNK2001: unresolved external symbol _RTC_InitBase
GENERAL.obj : error LNK2019: unresolved external symbol _RTC_CheckStackVars referenced in function Emulate_GetDiskFreeSpaceEx
main.obj : error LNK2001: unresolved external symbol _RTC_CheckStackVars
GENERAL.obj : error LNK2001: unresolved external symbol __GSHandlerCheck
main.obj : error LNK2001: unresolved external symbol __GSHandlerCheck
GENERAL.obj : error LNK2019: unresolved external symbol __security_cookie referenced in function Emulate_GetLongPathName
main.obj : error LNK2001: unresolved external symbol __security_cookie
GENERAL.obj : error LNK2019: unresolved external symbol __security_check_cookie referenced in function Emulate_GetLongPathName
main.obj : error LNK2001: unresolved external symbol __security_check_cookie
GENERAL.obj : error LNK2001: unresolved external symbol __CxxFrameHandler3
main.obj : error LNK2001: unresolved external symbol __CxxFrameHandler3
GENERAL.obj : error LNK2001: unresolved external symbol __GSHandlerCheck_SEH
GENERAL.obj : error LNK2019: unresolved external symbol _RTC_UninitUse referenced in function "int __cdecl UrlCompare(char *,char *)" (?UrlCompare@@YAHPEAD0@Z)
GENERAL.obj : error LNK2001: unresolved external symbol __GSHandlerCheck_EH
main.obj : error LNK2001: unresolved external symbol __GSHandlerCheck_EH
main.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl CxMemFile::Close(void)" (?Close@CxMemFile@@UEAA_NXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual unsigned __int64 __cdecl CxMemFile::Read(void *,unsigned __int64,unsigned __int64)" (?Read@CxMemFile@@UEAA_KPEAX_K1@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual unsigned __int64 __cdecl CxMemFile::Write(void const *,unsigned __int64,unsigned __int64)" (?Write@CxMemFile@@UEAA_KPEBX_K1@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl CxMemFile::Seek(long,int)" (?Seek@CxMemFile@@UEAA_NJH@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CxMemFile::Tell(void)" (?Tell@CxMemFile@@UEAAJXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CxMemFile::Size(void)" (?Size@CxMemFile@@UEAAJXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl CxMemFile::Flush(void)" (?Flush@CxMemFile@@UEAA_NXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl CxMemFile::Eof(void)" (?Eof@CxMemFile@@UEAA_NXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CxMemFile::Error(void)" (?Error@CxMemFile@@UEAAJXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl CxMemFile::PutC(unsigned char)" (?PutC@CxMemFile@@UEAA_NE@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CxMemFile::GetC(void)" (?GetC@CxMemFile@@UEAAJXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual char * __cdecl CxMemFile::GetS(char *,int)" (?GetS@CxMemFile@@UEAAPEADPEADH@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CxMemFile::Scanf(char const *,void *)" (?Scanf@CxMemFile@@UEAAJPEBDPEAX@Z)
main.obj : error LNK2019: unresolved external symbol "public: __cdecl CxMemFile::CxMemFile(unsigned char *,unsigned long)" (??0CxMemFile@@QEAA@PEAEK@Z) referenced in function "public: void __cdecl CxMemFile::`default constructor closure'(void)" (??_FCxMemFile@@QEAAXXZ)
main.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl CxMemFile::~CxMemFile(void)" (??1CxMemFile@@UEAA@XZ) referenced in function "public: virtual void * __cdecl CxMemFile::`scalar deleting destructor'(unsigned int)" (??_GCxMemFile@@UEAAPEAXI@Z)
main.obj : error LNK2019: unresolved external symbol "public: bool __cdecl CxImage::Destroy(void)" (?Destroy@CxImage@@QEAA_NXZ) referenced in function "public: virtual __cdecl CxImage::~CxImage(void)" (??1CxImage@@UEAA@XZ)
main.obj : error LNK2019: unresolved external symbol "public: bool __cdecl CxImage::DestroyFrames(void)" (?DestroyFrames@CxImage@@QEAA_NXZ) referenced in function "public: virtual __cdecl CxImage::~CxImage(void)" (??1CxImage@@UEAA@XZ)
main.obj : error LNK2019: unresolved external symbol "public: __cdecl CxImage::CxImage(unsigned long)" (??0CxImage@@QEAA@K@Z) referenced in function "public: void __cdecl CxImage::`default constructor closure'(void)" (??_FCxImage@@QEAAXXZ)
main.obj : error LNK2019: unresolved external symbol "public: __cdecl CxImage::CxImage(class CxImage const &,bool,bool,bool)" (??0CxImage@@QEAA@AEBV0@_N11@Z) referenced in function "public: void __cdecl CxImage::`copy constructor closure'(class CxImage &)" (??_OCxImage@@QEAAXAEAV0@@Z)
main.obj : error LNK2019: unresolved external symbol "public: long __cdecl CxImage::Draw(struct HDC__ *,long,long,long,long,struct tagRECT *,bool)" (?Draw@CxImage@@QEAAJPEAUHDC__@@JJJJPEAUtagRECT@@_N@Z) referenced in function "__int64 __cdecl WndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?WndProc@@YA_JPEAUHWND__@@I_K_J@Z)
main.obj : error LNK2019: unresolved external symbol "public: bool __cdecl CxImage::LoadResource(struct HRSRC__ *,unsigned long,struct HINSTANCE__ *)" (?LoadResource@CxImage@@QEAA_NPEAUHRSRC__@@KPEAUHINSTANCE__@@@Z) referenced in function "__int64 __cdecl WndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?WndProc@@YA_JPEAUHWND__@@I_K_J@Z)
.\Debug/eSLogOn.dll : fatal error LNK1120: 31 unresolved externals
Creating browse information file...
Microsoft Browse Information Maintenance Utility Version 8.00.50727
Copyright (C) Microsoft Corporation. All rights reserved.
Build log was saved at "file://e:\source\MyVcPrjs\cximage600_full\eSLogOn\x64\Debug\BuildLog.htm"
eSLogOn - 42 error(s), 1 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
|
|
|
|
|
I had asked to remove iostream.h include, and put <iostream> instead. Try that out. The other possibility is you are not able to link with msvcprtd.lib. Check whether the path for msvcprtd.lib is included into the project settings. Search for the lib, and make sure the paths are there in include directory.
Probably
\Program Files\Microsoft Visual Studio 8\VC\lib
\Program Files\Microsoft Platform SDK\ (SDK Folder)
for AMD64.
|
|
|
|
|
Seems you're application is targeted to run under 64-bit environment.
Please put $:\Program Files\Microsoft SDK\Lib\IA64 (AMD64) in the top of lib directories. (Tools->Options->VC++ Directories).
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Thankx Sarath
after Changing the settings as u said i got the following error
LINK : warning LNK4076: invalid incremental status file '.\Debug/eSLogOn.ilk'; linking nonincrementally
version.lib(VERSION.dll) : fatal error LNK1112: module machine type 'IA64' conflicts with target machine type 'x64'
|
|
|
|
|