|
Depends on what you are trying to do.
1. If all your processes are on the same machine, and you don't need a lot of data, or the data is of the same format every time, you can use memory mapped files.
2. You can use TCP/IP and sockets to send data back and forth, also works over the network.
3. If it is a TINY amount of infrequent data, with no return recipt required, you could look into MailSlots.
4. Hey, you can even use COM, but what a pain in the backside! (Marshaling data, getting hrreading mdoels and initialization to work right, DCOM settings, etc.)
5. You can use Local RPC (everything running on same computer) or Remote RPC (not necessarily on same computer).
6. WM_COPYDATA - sending data between windows of different processes.
Your question is impossible to answer appropriately without more details.
But you might want to read a little bit about each of the technologies mentioned here, and then you can make your own decision.
|
|
|
|
|
Hi Blake and thanks for the input.
Looking back at you posted, I think I will have to go for the COM solution as I think it is the best one.
Can I ask you one thing though? Do you know of any site(s) with the right technical content I could learn from?
|
|
|
|
|
I use CodeProject and MSDN almost exclusively.
You can post an aritcle request here on CodeProejct, and someone might write a tutorial on COM as it pertains to InterProcess Communications (IPC).
I am sorry that I don't have a recommendation for an excellent COM site. Maybe another user here could come up with some suggestions. Also, try the COM forum on CodeProject (unless you already did...)
|
|
|
|
|
Anyone ever write any app wizards for eVC4? I tried using a awx from VC6 and that didn't work (no real surprise). I can't find much info on how you create them however. Any pointers (links, etc) would be much appreciated!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Never mind - it helps to look in the Help files a little more - oops
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Hello,
My question is: would it be possible to make a correct screen capture if a video file is playing at that moment ? (not necessarily in full screen)
I saw what are the methods for capturing the screen via d3d but for videos playing the capture consists just in a black square !
Would it be a solution for this?
Thanks.
|
|
|
|
|
hi!
i've written a little template class test app & am having real problems trying to build it. it all compiles fine but i get LNK2019 errors for every method of the template class used in 'main'. i've copied the code & build output below, & would really appreciate ANY help you can give. thanks!!
#ifndef _TEST_H_
#define _TEST_H_
template <class type> class Test
{
public:
void SetMember(type Val);
type GetMember();
Test<type>& Copy();
private:
type m_Member;
};
#endif // _TEST_H_
i've gotta feeling that i've implemented the class methods incorrectly, but really can't see how!?
#include "test.h"
template <class type>
void Test<type>::SetMember(type Val)
{
this->m_Member = Val;
}
template <class type>
type Test<type>::GetMember()
{
return this->m_Member;
}
template <class type>
Test<type>& Test<type>::Copy()
{
return *this;
}
#include <iostream>
#include "test.h"
using namespace std;
int main()
{
Test<int> tst;
cout << "TEMPLATE TEST PROGRAM..." << endl << endl;
tst.SetMember(68);
cout << "TEST CLASS RETURNS\t" << tst.GetMember() << endl;
Test<int> tst2 = tst.Copy();
cout << "TEST CLASS 2 RETURNS\t" << tst2.GetMember() << endl;
cout << "Press any key to end..." << endl;
cin.get();
}
the above code produces the following errors on build...
------ Build started: Project: template_test, Configuration: Debug Win32 ------
Compiling...
test.cpp
Linking...
main.obj : error LNK2019: unresolved external symbol "public: class Test<int> & __thiscall Test<int>::Copy(void)" (?Copy@?$Test@H@@QAEAAV1@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: int __thiscall Test<int>::GetMember(void)" (?GetMember@?$Test@H@@QAEHXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Test<int>::SetMember(int)" (?SetMember@?$Test@H@@QAEXH@Z) referenced in function _main
Debug/template_test.exe : fatal error LNK1120: 3 unresolved externals
template_test - 4 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
|
|
|
|
|
Copy all code of test.cpp at the end of test.h , remove test.cpp from project, and you will be done!
ARSALAN MALIK
|
|
|
|
|
thanks!! that works!! why is that?? i thought when a class is used in more than one module (.cpp) you have to implement class methods etc in a separate cpp!? does the compiler do that for you for every specialisation then??
|
|
|
|
|
I remember a person asking the same thing a couple of days ago... The answer can be found here[^]
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hi everyone, i am in the process of writing a virtual keyboard, i have all the functionality in place, but am unable to pass the keystrokes to an underlying program, eg a new mail message. if anyone has any pointer it would be much appreciated.
|
|
|
|
|
SendInput Function -
The SendInput function synthesizes keystrokes, mouse motions, and button clicks.
|
|
|
|
|
I am using the keybd_event method, and it works ok, but only within my program, if i put a text box within my program then the keystrokes are displayed as expected in the box, i need to be able to pass these key strokes to another program, so if i had say notepad open when i press the keys on my virtual keyboard they appear in notepad ???
Lee
|
|
|
|
|
I am having this same problem. I want to send keyboard strokes from my program to other windows applications. How would one go about this problem?
|
|
|
|
|
Hello! I am new to MFC.
I want to change an Edit Box from a function!
The situation is the following (simplified):
<br />
<br />
int function();
<br />
void TestDlg::OnGo()<br />
{<br />
SetDlgItemText(IDC_Output, "From OnGo!!!");
function();
}<br />
<br />
int function()<br />
{<br />
SetDlgItemText(IDC_Output, "From funtion()!!");
}<br />
<br />
So, the output from the function does not work. I know, I have to append something, but what?????
|
|
|
|
|
Try like this from function
CEdit *edit;
edit=(CEdit*)GetDlgItem(IDC_Output);
edit->SetWindowText("From function()!!");
Regards
Alpha
|
|
|
|
|
Doesnt work, GetDlgItem() asks for Window Hande (doesn't accept 1 Parameter)!
How can I get this?
WoodStock
|
|
|
|
|
Their are two versions of GetDlgItem.
1. The SDK version needs two param
2. The CWindow::GetDlgItem and CWnd::GetDlgItem needs 1 param.
Are you getting some compiler errors ?.
Regards
Alpha
|
|
|
|
|
There are two solutions to your problem:
1. Make function() a member of of your TestDlg class.
or,
2. You need to pass handle of dialog window (HWND) to SetDlgItemText as first parameter, in function :
SetDlgItemText(hWnd, IDC_Output, "From funtion()!!");
You may pass this handle to function . This handle is member of TestDlg class with name m_hWnd .
ARSALAN MALIK
|
|
|
|
|
How can I make function() a member of my TestDlg class?????
|
|
|
|
|
You've not shown what the error is. Although it's obvious in this example, it still doesn't hurt to be explicit.
Change function() to:
int TestDlg::function()
{
...
} and don't forget to add the prototype to the class.
Don't use SetDlgItemText() . Use ClassWizard to create a control variable (CEdit in this case) and use the SetWindowText() method to change the text.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have a volume control prog. downloaded and written the necessary hotkey code lines based on
Beginner's Tutorial - Using global hotkeys
http://www.codeproject.com/system/nishhotkeys01.asp
into it.
The hotkey succesfully registers.
RegisterHotKey(this->m_hWnd, myatom, MOD_CONTROL, VK_UP)
on querying this line I get a true
in the header:
public:
...
LRESULT OnHotKey(WPARAM wParam, LPARAM lParam);
...
DECLARE_MESSAGE_MAP()
in the correspondig cpp file:
BEGIN_MESSAGE_MAP(CVolumeControlDemoDlg, CDialog)
//{{AFX_MSG_MAP(CVolumeControlDemoDlg)
... // some more messages
ON_MESSAGE(WM_HOTKEY,OnHotKey)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
and also in the cpp file:
LRESULT CVolumeControlDemoDlg::OnHotKey(WPARAM wParam, LPARAM lParam)
{
if(wParam == MOD_CONTROL && lParam == VK_UP) {
log.write("!!! HOTKEY PRESSED SUCCESS !!!");
}
return 0;
}
on pressing the hotkey while the prog is running -> NOTHING happens. But if I call the following line in the code I get the WM_HOTKEY message correctly:
SendMessage(WM_HOTKEY, MOD_CONTROL, VK_UP);
What am I doing wrong? Plz in very easy language since I am a programming N00b. TY
|
|
|
|
|
Hi,
I am using InternetGetConnectedState to determine, whether a LAN connection exists.
IBZHTTP_API LRESULT canConnectLAN() {
DWORD dwFlags;
InternetGetConnectedState(&dwFlags,0);
return LRESULT( 0 < (dwFlags & INTERNET_CONNECTION_LAN) );
}
I tested this function on two computers(PC1, PC2), both connected to the same LAN. Both have additionally RAS installed and a proxy exists. The LAN connections are activated.
PC1: Return value dwFlags is 56, which is correct, it means
INTERNET_CONNECTION_LAN (0x02)
INTERNET_CONNECTION_PROXY (0x04)
INTERNET_RAS_INSTALLED (0x10)
INTERNET_CONNECTION_CONFIGURED (0x40)
PC2: Return value dwFlags is 50 which is not enough, it means only
INTERNET_RAS_INSTALLED (0x10)
INTERNET_CONNECTION_CONFIGURED (0x40)
When RAS connections with modem are defined on PC2, dwFlags is correct with respect to RAS, 51:
INTERNET_CONNECTION_MODEM (0x01)
INTERNET_RAS_INSTALLED (0x10)
INTERNET_CONNECTION_CONFIGURED (0x40)
What could be the reason, that InternetGetConnectedState does not report the LAN connection on PC2?
Thank you
Werner
|
|
|
|
|
Hi,
I have an application which accesses an archive file. And my application is multi instance application. When I open an archive file in the first instance of the application then I Should lock that archive file so that when I try to open the same archive file (which is locked in the first instance) in the second instance of the application then application should give error or throw an exception.
Plz, help me in this.
Any adea/code sample?
Thanks & Regards,
Neeraj
|
|
|
|
|
Hi Neeraj,
Use CFile::shareDenyRead,CFile::shareDenyWrite, or CFile::shareExclusive as a nOpenFlags for Open function.
Regards
Alpha
|
|
|
|