|
DDE (Dynamic Data Exchange) was the forerunner to COM. It allows applications to communicate with each other. A search on MSDN should answer your technical queries. The DDEML library will allow you to write your own DDE Server and clients, although COM would be the better approach.
Michael
|
|
|
|
|
It stands for Dynamic Data Exchange. It is a way to create interprocess communication with windows operating systems. It was really big for Windows 3.1. It works through the messaging system built into windows.
It is a somewhat simple mechanism, but if you can avoid using it I would use some other tool. There are better methods now. You could even use COM / OLE which provides a ton more features, and isolates you from alot of the details for client server programming.
If you are set on using DDE to create an mIRC plugin, you can start by looking up the WM_DDE_ family of messages in MSDN or msdn.microsoft.com. I know there is a very basic sample of a DDE client / server program in Charles Petzolds Programming Windows book.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
hmmmm
client / server stuff ... unicode ... tcp/ip just transfers streams of bytes that can be TCHARS or whatever else u want them to be ... should one make the client / server work in char's and do the conversions / scaling of buffers in code or should one work in TCHARs and do the opposite?
just seems a real pain using unicode with tcp/ip
prolly not the clearest post i know
"... and so i said to him ... if it don't dance and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I think that it all depends.
Who are your users , will they require a lot of UNICODE support, or are you just thinking ahead?
There are basically two ways to go:
1) Are you sending a lot of text across the socket frequently? Because if you are only sending a couple hundred characters then I would say it is not worth worrying about and I would deal with it in TCHARS. The drawback to this is that you will need to deploy two versions of your server and client, or at least they will need to differentiate between the two different types of packets that you send. WCHAR vs CHAR.
Another alternative to think about is to compress your text data before you send it. For most of the latin based language locales, all of the extra bytes in the UNICODE strings will be easily compressed. But you will still need to have two versions of the client, one ansi and one unicode.
2) If you are sending megabytes of characters, and you can spare the processing power, then you may want to consider reducing the data to CHAR data types, however you will want to make sure to use the multibyte conversions in order to prevent the loss of data for locales that actually depend on the UNICODE format.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
thanks
yah its kinda thinking ahead and the fact that i always code in unicode ... its kinda a habit these days
the traffic is not great so maybe just grim it out with wierd buffer manipulation code
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
Hi,
I'm writing a program that takes text from a file, and converts it to HTML. At first I tried using the CStdioFile::Replace() function, but that didn't work cause I don't need to replace everything. I think what I need to do, is Find() a certain string, and then Insert() something before it. The only problem is I can't get past the first line.
Say I make CStdioFile Story, fill it with a story about pies, then do this:
int pos;
pos = Story.Find("pie", 0);
Story.Insert(pos, "apple ");
That works fine, but it only does it once. What should I do if Story is full of 'pie' and I want to change it all to apple pie?
Thank you, any help would be appreciated.
|
|
|
|
|
I could be completely wrong, but after searching the documentation I couldn't find any member functions called Find nor Insert in CStdioFile or its base classes.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You're right, and I'm an idiot. I mean CString, sorry.
|
|
|
|
|
See the replaceAll() method in this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I've got an assignment that says make a game of blackjack. Use random numbers, loops, arrays, functions, ect. Any advice would be greatly appriciated. Thanks
|
|
|
|
|
Is this an assignment for a windows program, or a console app.
If you are using windows you can find the images for the cards in cards.dll.
Otherwise, if this is for homework, I would be glad to guide you in the right direction if you tell me what your initial ideas are.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi kilowatt.
I have a question about it.
kilowatt wrote:
If you are using windows you can find the images for the cards in cards.dll.
How can I get some images from a dll file?
Thanks
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Do you want to use the DLL and load the images into your program?
If so, you can first load the DLL that you want to use the images from with LoadLibrary . Save the HMODULE that you recieve from LoadLibrary because you will need to use that handle when you call LoadBitmap or LoadImage to load the image from the DLL. These functions will give you an HBITMAP that you can use in your program.
When you load the bitmap, you will need to know the resource ID of the bitmap that you are interested in. You can determine this by loading the DLL into DevStudio and looking at its resources. Also, you will need to use the MAKEINTRESOURCE macro to properly format the ID for the bitmap load function so that it knows you are passing in an integer rather than a string name.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thank you very much kilowatt.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
It's not in windows. It's just a dos program. I'm not sure if that's console app. If you can, e-mail me at nywebhead@hotmail.com and I'll give you the details, thanks.
|
|
|
|
|
Hi All!
I'm trying to SetFont to CWnd-derived class, but it has no effect.
I'm using member variable in my class - CFont m_font.
In my OnCreate method:
LOGFONT lf; // Used to create the CFont.
memset(&lf, 0, sizeof(LOGFONT));// Clear out structure.
lf.lfHeight = 20; // Request a 20-pixel-high font
strcpy(lf.lfFaceName, "Arial"); // with face name "Arial".
m_font.CreateFontIndirect(&lf); // Create the font.
SetFont(&m_font);
CFont *pFont = GetFont();
pFont is NULL!!!
I'm sure that font object (m_font member) remains valid, so that is not the reason.
I even tried to SetFont to child windows of this window (e.g Button or Static control)
m_wndChild.CreateEx(0, _T("Button"), m_csText, WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON, rctChild, pParent, 0x1234);
m_wndChild.SetFont(&(pParent->m_font));
No effect...
Can anybody tell me what's wrong?
Thank you
Levon Hayrapetyan,
Student
Yerevan State University
|
|
|
|
|
Try use
::CreateFontIndirect(&lf);
|
|
|
|
|
update:
Try Use m_Font = ::CreateFontIndirect(&lf);
|
|
|
|
|
update:
Try Use ->
m_font = ::CreateFontIndirect(&lf);
|
|
|
|
|
In an activeX (MFC) project I have defined a structure like this:
struct aaa
{
BSTR name;
int length;
}properties[200];
I have declared this structure in the C...Ctrl class.
I want the container to access the properties member (ctrlname.properties[1].name
Is it possible ? If so, how do I do that ?
|
|
|
|
|
Add a method to your ActiveX for the container to call. Have the method return the value you desire.
Goo luck,
Bill
|
|
|
|
|
hi, i'm implementing and MFC SDI application. I've inserted a new Dialog and put 1 list box in there. When i tried to add the string to the list box from the View in MFC it just display erorr. Here is the code fragment that i used in my view class:
CAss3_q1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
Dlg dialog;
dialog.DoModal();
for (int i = 0; i< 4; i++)
{
dialog.m_team1.AddString(pDoc->A.getTeam(i));
}
It just didnt' load up and give me runtime error. ANy hints or tips.
Note: I tried to load the 4 CString object to the list, and this 4 string is in a class call group that have the method as below
CString Group::getTeam(i)
{
return team[i];
}
Cheers
|
|
|
|
|
DoModal() displays the dialog and waits until the dialog ends, typically by the user clicking OK or Cancel. You should pass a pointer to CAss3_qlDoc to your dlg object, and initialize the list box from within the dialog's OnInitDialog() handler.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello
As you you probably understands from the question's I'm asking I'm not a very experieced developer.
I'm having trouble to understand how i can get the document length on the document i want to print..
Must I first calculate the number of rows in the document in OnPreparePrinting and then
calculate the no: of pages to set as maxpage and must I then ceep track on wich page that is currently printing in the OnPrint function. Is this all wrong? If not is there an easiyer way to do this.
It would be great to get hold of a small example code to do this.
Thanks for taking your time.
Best regards
Henrik
|
|
|
|
|
You can use the following code to give the printer page size.
int cx = nPageWidth;
int cy = nPageLength;
static int screenXDpi = 0;
static int screenYDpi = 0;
if (screenXDpi == 0 || screenYDpi == 0)
{
CDC dcScreen;
dcScreen.CreateCompatibleDC(0);
screenXDpi = dcScreen.GetDeviceCaps(LOGPIXELSX);
screenYDpi = dcScreen.GetDeviceCaps(LOGPIXELSY);
}
cx = (cx * 1440) / 2540;
cy = (cy * 1440) / 2540;
cx = (cx * screenXDpi) / 1440;
cy = (cy * screenYDpi) / 1440;
nPageWidth = cx;
nPageLength = cy;
Regards
Jack
--------------------------------------
Xtreme Diagram++ MFC Library with full source code.
http://www.ucancode.net/
|
|
|
|