Use SetDlgItemText(...) function in the OnInitDialog() handler of the dialog box. eg SetDlgItemText(IDC_E_DATA,string_data); R.Balachandran
balcn
Posts
-
problem setting text in edit box -
COM Client problemHere I have given a sample working code for a COM client // COMClientDlg.cpp : implementation file #include "stdafx.h" #include "COMClient.h" #include "COMClientDlg.h" #include "COMServer.h" #include "COMServer_i.c" ............................ ............................ ............................ HRESULT hr; IMessage *msg; hr = CoInitialize(0); //initialize COM if( SUCCEEDED(hr) ) { hr = CoCreateInstance( CLSID_Message, NULL, CLSCTX_INPROC_SERVER, IID_IMessage, (void **)&msg ); if( SUCCEEDED(hr) ) { msg->Show(); msg->Release(); } else { AfxMessageBox("Cannot create COM object"); } CoUninitialize(); //uninitialize COM } else { AfxMessageBox("Cannot initialize COM"); } This code worked fine when I tested under an MFC dialog project. The server was created as a DLL by the ATL wizard. While creating a simple object the following options were selected. Threading Model - apartment Interface - dual Aggregation - yes If you still have trouble you can mail your code to me R.BALACHANDRAN
-
COM Client problemDid you use the ATL wizard? What is the error yu get? R.Balachandran
-
how to load a jpg/bmp image ?The following example code can be used for loading a BMP file image in any vc++ application. HBITMAP hbitmap; hbitmap = (HBITMAP)LoadImage(NULL,"C:\\house.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE); HDC hmemdc; hmemdc = CreateCompatibleDC(pDC->m_hdc); SelectObject(hmemdc,hbitmap); BitBlt(pDC->m_hdc,0,0,image_width,image_height,hmemdc,0,0,SRCCOPY); For viewing as a background image in an SDI application the above code can be used inside the OnDraw(CDC *pDC) method of view class. For loading a JPEG file you can use external JPEG libraries such as the IJL15.DLL which is freely available. R.Balachandran