|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
Where I can get the free ebook
Inside COM by dale rogerson
|
|
|
|
|
It's not free, as far as I know.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes , there is NO e-book available for download.
|
|
|
|
|
Thread marked as answered.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Thank you, man.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi!
I've to mail a file to an id using MFC. How to do this?
|
|
|
|
|
Something like one of these[^] perhaps.
The best things in life are not things.
|
|
|
|
|
pix_programmer wrote: How to do this?
Start here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Here it is. [^]
A Very well encapsulated and easy to use class by Jakub Piwowarczyk.
You can directly use it in your MFC project.
|
|
|
|
|
Hi,
I have derived CMyFileDialog from CFileDialog.
Defining the OnFolderChange I can handle CDN_FOLDERCHANGE
void CMyFileDialog::OnFolderChange()
{
// Code to change folder
}
I can access the "look in" ComboBox (cmb2) and the list box that displays
the contents of the current drive or folder (lst1).
How can I change the folder so that also the list box change its content?
I tried with GetCurrentDirectory(), but obviuosly it doesn't work, neither
cmb2 nor lst1 are graphically updated. Using SetCurSel on cmb2 the lst1
is not updated.
I need that both cmb2 and lst1 change.
Thanks,
|
|
|
|
|
Shouldn't you use SetCurrentDirectory ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
Thank you for your reply.
"SetCurrentDirectory" does not work for me.
I tried to add a "button" to file open dialog box. After I click this button, I want the file open dialog box to change its current Directory.
Thanks,
|
|
|
|
|
I want to make a dialog based application with a Modeless Dialog similar to the OSK.exe shipped with windows . This modeless dialog box should not receive focus once I have set focus to another window of another process for e.g Notepad Window. Can somebody help ?
|
|
|
|
|
If you set focus to Notepad then focus will remain there until you move it to another window. What's the problem?
The best things in life are not things.
|
|
|
|
|
|
Rajesh has supplied a good article about what you need, but this message[^] is specifically how to avoid the whole focus issue. It's all C#, but hopefully you can 'tranlsate' to C++.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
That's an excellent post you've pin pointed. Have a vote.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Thanks Rajesh. You got me started with that article link.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
You're welcome. And because you pointed him to the C# code, I advised (see my new reply to the OP below) on how to do that in C++.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
In addition to what I suggested previously, Chris give you a very valuable suggestion. The message he pin pointed is in C#.
If you're using MFC, then you could see the example in this page: Changing the styles of a window created in MFC[^]. The list of available extended window styles is here: Extended Window Styles[^], and you should be specifically interested in WS_EX_TOOLWINDOW and WS_EX_NOACTIVATE .
If you're using Win32 programming, then you could set the style of the window while making a call to CreateWindow[^]. Pay attention to the third parameter, which is DWORD dwStyle .
Hope that helps.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Hi ALL,
How can i simulataneously read and write the values from other process.
I want to use Memory Mapped,but not clear with the concept ,how to write and read using it.
I have two procees,
1)where in from one process i get values from hardware,
example : LateralX=10, LongitudinalY=12 ... etc
2) In the second process i display the values in GUI.
Each time the hardware moves the values changes and reflects in GUI
Now presently i am using global variables to get the values.
How can i do the same with Memory Mapped file.
can someone suggest me any idea,how can i do this or any sample example..
Thanks
Sharan
|
|
|
|
|
|
Thanks a lot for the link given,it is very helpfull
If i want to write more then one value in one process.
How can i do it.
Presently now this is a msg i am writing into
Example
TCHAR szMsg[]=TEXT("Message from first process.");
CopyMemory((PVOID)pBuf, szMsg, (_tcslen(szMsg) * sizeof(TCHAR)));
This is how i am writing the message to Memory.
How can i do it for more then one message(multiple values)
In process2.cpp
Same way can i read more then one value from the other process
hMapFile = OpenFileMapping(
FILE_MAP_ALL_ACCESS,
FALSE,
szName);
pBuf = (LPTSTR) MapViewOfFile(hMapFile,
FILE_MAP_ALL_ACCESS,
0,
0,
BUF_SIZE);
MessageBox(NULL, pBuf, TEXT("Process2"), MB_OK);
Here i am reading the value from 1st process,how can i read multiple values
Thanks
Sharan
|
|
|
|
|
Let's just pause for a second, and think about it..
Your first process takes some data (in this case, a character based string) and copies it into a buffer.
Your second process reads from that buffer and displays this info as a string. The second process has no inherent knowledge of the data structure of the shared memory.
This much is no different to any normal file - it is up to the definer of the data to decide how it will be stored, and as a consequence, how it will be retrieved.
So, instead of blindly copying the message to the buffer, you may decide to use the first 4 bytes (for example) of the buffer to store the number of messages being passed. You may then write your messages 1 after another - remembering to make sure you have a null terminator between each string.
Here's some code that will demonstrate the concept:
#include <stdio.h>
#include <stdlib.h>
#define buffSize 2048
char buffer[buffSize];
void initBuffer()
{
memset((PVOID)buffer, 0, sizeof(char) * buffSize);
}
int addMsg(char *msg)
{
long msgCount, curMsgIndex, curMsgLen;
char *newStrPos;
memcpy((PVOID)&msgCount, buffer, sizeof(long));
newStrPos = (char*) (long)&buffer + sizeof(long);
for (curMsgIndex=0; curMsgIndex<msgCount; curMsgIndex++)
{
curMsgLen = strlen(newStrPos);
newStrPos += curMsgLen + 1;
}
{
printf("adding message\n");
strcpy(newStrPos, msg);
msgCount++;
memcpy((PVOID)buffer, &msgCount, sizeof(long));
}
}
void printMessages()
{
long msgCount, curMsgNum;
char *curMsg;
memcpy(&msgCount, buffer, sizeof(long));
curMsg = (char*)(long)&buffer + sizeof(long);
for (curMsgNum=0; curMsgNum<msgCount;curMsgNum++)
{
printf("%s\n", curMsg);
curMsg += strlen(curMsg) + 1;
}
}
int main()
{
initBuffer();
addMsg("This is msg 1");
addMsg("This is msg 2");
printMessages();
return 0;
}
S.
|
|
|
|