|
Ick. I don't think the P/Invoke and COM marshallers work well together. Use one or the other, but not both.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I copied a project over to another directory in VC 6.0, and I had some trouble with it not recompiling so I hit rebuild all. Now ALL the IDE will do is recompile - it is ignoring the precompiled headers, and rebuilding every single time. Is there a directory pointer that may be misplaced? Anybody encountered this problem before?
|
|
|
|
|
The only time I have seen this is if the date/time of the file is after the current date/time.
Can be encountered when you save files and alter the clock backwards!!
Ant.
|
|
|
|
|
Yep - that was it, thanks for the help.
|
|
|
|
|
All I want is the ability to share data between a DLL (Loaded dynamically) and a EXE application.
I have tried the shared data segment - no good (only for instances of the same program). Works with 2 EXEs - tried it today.
Next I tried Mailslots, but the Mailslot (Server) need to be in the DLL, so how does it read the Mailslot and how do you arrange for it to be created as no Entrypoint in the DLL.
I did try and arrange when one of the functions wa called it would first setup the Mailslot, but never managed to have the Client attach to it.
They must be a simple way to have 3 interger values shared between this EXE and DLL.
Been on the problem all day now!
Help!!
|
|
|
|
|
|
Just to elaborate a bit on what Michael said, what I would do is define a data structure that will contain your shared data. Then write a function that will return a pointer to the shared data. Within that function use the implemention that Michael described. I have used this technique many, many times and it is very easy.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
I have already define a simple structure for the data (3 integers and a 80 char string).
I have used Mailslots (hence the structure already defined) and Sockets, but never used File Mapping before. Any simple examples?
I have seen some but wapped up with other IPC stuff. Also never used the GUID before.
regards,
Sweep.
|
|
|
|
|
Here are two :
http://www.codeproject.com/threads/csharedstruct.asp
http://www.codeproject.com/threads/sharedmemipc.asp
Good luck.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
Thanks Rick. I had already found your first link last night and got it working before the e-mail came through.
You were right, quite simple to implement.
Sweep.
|
|
|
|
|
right well i installed visual studio on my home pc so that i could run my c++ pojects and now when i surf the internet some pages bring up an error window and make a really annoying noise and ask me if i want to debug the page, im sure someone knows what im talkin about, how do i stop this, its so head melting
thanks
colum
|
|
|
|
|
Go in IE to Tools->Internet options->Advanced
Then click Disable Script debugging
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
ah yes now thats what im taking bout, fast accurate reply's... thanks a lot
|
|
|
|
|
I have the following code that reads all the messages currently in the user's inbox and inserts them into a listview. I'm using automation and everything seems to be working fine except for getting the sender's email address. There's a property for getting the sender's name, but not the email address. here's the code I have so far. Hope anyone can help!! Thanks!!
void COtestDlg::OnRun()
{
MapiMessage mm;
MAPIFolder folderInbox;
_NameSpace ns;
_Items itemsMessages;
_MailItem mi;
_Application app;
if(!app.CreateDispatch("Outlook.Application"))
{
AfxMessageBox("Couldn't start Outlook.");
}
else
{
ns = app.GetNamespace("MAPI");
COleVariant vt;
COleVariant vtOptional("");
COleVariant vtTrue;
vt.ChangeType(VT_BOOL);
vt.boolVal = true;
vt.ChangeType(VT_I2,NULL);
ns.Logon(vtOptional, vtOptional, vtTrue, vtTrue);
folderInbox = ns.GetDefaultFolder(6);
itemsMessages = folderInbox.GetItems();
for (int x = 0; x < itemsMessages.GetCount(); x++)
{
mi = itemsMessages.Item(COleVariant((long) x + 1L));
m_lvwResults.InsertItem(x,mi.GetSenderName());
m_lvwResults.SetItemText(x,1,mi.GetSubject());
m_lvwResults.SetItemText(x,2,mi.GetBody());
}
ns.Logoff();
}
}
If it's broken, I probably did it
bdiamond
|
|
|
|
|
|
Yes, that worked perfectly, thanks!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Topic says it all, how can I transform a jpg to a bmp in C++?
|
|
|
|
|
|
Hello,
I have two programs that I have to use one after another. The first one's goal is to configure data you use with the second. So I have to leave the first to use the second. And if I want to change the configuration, I have to quit the second to return in the first one, change the configuration. Then I can quit the configuration program and come back in the second program.
So this is very fastidious because I always have to do the same thing twice (I always have to change the configuration once, and this is always the same thing)
I don't have the source code so I cannot modify it
So my question is (finally...) is there a way to do a program that runs other programs and that modifies comboboxes and stuff the way a REAL user could do it?...
Thank you in advance
If someone did not understand what I meant please tell me too
an allarc'h zo bet
|
|
|
|
|
Hint:
FindWindow
SendMessage
Spy++
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
thanks but: findwindow and sendmessage can't work (I think) as I can't access the source code of the program I want to run(I want to run it with a program but the way a user could run it, and modify comboboxes choices, click on button...).
I'm not familiar with Spy++: I just made a few search on google as you recommended it, but it seems to show the threads that are running on the PC, the UC occupation and all this stuff so I don't understand the link with my question, could you precise your hint?
Thanks
|
|
|
|
|
You dont need source code.
Using Spy++ you can get the class of the window u want to send message to and the messages to send,
using FindWindow you cant get a handle to the window, and using SendMessage you just send the message you saw in Spy ++ to the window, thus making it behave just like if a user is testing it
Consider also using CWnd::Attach and CWnd::Detach
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hello.. All
I have my application and the application 2. app2 sends the window messages and I don't know how to capture those messages. I'm using .Net c++ and the following example was provided by app2.
My application is Dialog-based application.. and I don't know how to convert the following code or capture the messages from other application at all.
The app2 said register a message ( could be anything) and my application also has to register the same message as app2. (that's I don't know how)
then app2 will start sending messages and my app has to capture and process those messages. ( I have no idea how to capture the messages either)
I kind of have the idea of GetMessage() as it is shown in the example. but how?
<br />
HINSTANCE hInst;<br />
LRESULT CALLBACK TestWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);<br />
<br />
int PASCAL WinMain(HINSTANCE hinstCurrent, HINSTANCE hinstPrevious, LPSTR lpszCmdLine, int nCmdShow)<br />
{<br />
<br />
WNDCLASS wc;<br />
<br />
<br />
wc.style = 0;<br />
wc.lpfnWndProc = TestWndProc;<br />
wc.cbClsExtra = 0;<br />
wc.cbWndExtra = 0;<br />
wc.hInstance = hInst;<br />
wc.hIcon = LoadIcon(hInst, TEXT("TestIcon"));<br />
wc.hCursor = LoadCursor(NULL, IDC_ARROW);<br />
wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);<br />
wc.lpszMenuName = TEXT("TESTMENU");<br />
wc.lpszClassName = szMyClass;<br />
<br />
if (!RegisterClass(&wc))<br />
return FALSE;<br />
<br />
HWND hwndMyWindow = CreateWindow(szMyClass, TEXT("Black Ice printer Driver Message Capture Sample"),<br />
WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, 0,<br />
CW_USEDEFAULT, 0, NULL, NULL,<br />
hInst, NULL );<br />
<br />
if ( !hwndMyWindow )<br />
return FALSE;<br />
<br />
ShowWindow (hwndMyWindow, SW_SHOW);<br />
<br />
while ( GetMessage(&msg, NULL, 0, 0 ) )<br />
{<br />
TranslateMessage(&msg);
DispatchMessage(&msg);
}<br />
return (int) msg.wParam;
}<br />
Thank you very much
you can save my life.
|
|
|
|
|
|
I would like to thank CodeProject for announcing me as the winner of the "Favorite MFC/C++ Article of March 2004[^]" competition. I would like to thank my best friend Kamal Sekhon for her continuous support. I would also like to thank Nishant (the editor of my article), Chris Maunder and the whole CodeProject team, AND last, but not the least, I would like to thank all those people who posted their prestigious comments, encouraged me a lot, gave their ideas/suggestions, and of course, rated my article to make all this possible.
Thank you all,
Gurmeet BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|