|
If the scroll bars are appearing automatically, it is likely that your dialog resource is larger than the default frame client area size.
Add a handler for the WM_GETMINMAXINFO in the CMainFrame class. You can then specify the min and max size for your windows.
<br />
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) <br />
{<br />
lpMMI->ptMaxSize.x = 700;<br />
lpMMI->ptMaxSize.y = 500;<br />
lpMMI->ptMaxTrackSize.x = 700;<br />
lpMMI->ptMaxTrackSize.y = 500;<br />
lpMMI->ptMinTrackSize.x = 700;<br />
lpMMI->ptMinTrackSize.y = 500;<br />
CFrameWnd::OnGetMinMaxInfo(lpMMI);<br />
}<br />
Michael
|
|
|
|
|
A quick way to remove the scroll bars is in the OnSize handler for the form view is to call:
SetScaleToFitSize(cx, cy) ;
You may also need to r-size any controls to porperly fit on the form.
As for the bitmap appearing in the middle of you tab control, check the tab order of the control in the resource editor (CTrl+D) and make sure that he bitmap is before the tab control to get he correct plot order.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
Hi,
I just created an app using VC++ and I think it needs a little spice so, I want to include graphics in my app, how can I put an image in the background (not 16 colors, 256+) like in msn messenger. I would like an image and I could put my controls on top of it. Actually when I do that today, my bitmap takes the whole place and all the controls are under it. And also, I want to make my image fit the entire application canvas.
Help me if you can please.
// JS Paquet
cout << "Thank you all" << endl;
|
|
|
|
|
If you want to use GDI+ check this
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Use stretchBlt, and paint the image in the WM_ERASEBKGND message.
|
|
|
|
|
I have tried "SetMargin", but it seems for print process?
I'm amumu, and you?
|
|
|
|
|
First of all, my equipment:
************************************Win2k Server******************************
Name: iras
Workgroup: HTBL
Domain for Windows: htlpinkafeld.at
Domain for Netware: htbl\
User: testuser@htlpinkafeld.at (in htlpinkafeld.at\edvoschueler)
No Password!! (only for testing)
******************************************************************************
***********************************Win2kProf (Workstation)********************
Programming Language: Microsoft Visual C++ 6.0
MSDN: April 2001
Workstation is in the same network like win2k server (of course!)
******************************************************************************
First step:
BINDING TO AN USER (testuser@htlpinkafeld.at)
I read that i should use the function
HRESULT ADsOpenObject(
LPWSTR lpszPathName,
LPWSTR lpszUserName,
LPWSTR lpszPassword,
DWORD dwReserved,
REFIID riid,
VOID FAR * FAR *ppObject
);
To do so, i had to import the following:
Header: Adshlp.h
Library: ActiveDS.Lib
PROBLEM:
The 5th parameter takes values which are neither in Adshlp.h nor in ActiveDs.Lib. So!! I found out that the needed stuff is in another lib called
"ADSIID.lib". BUT some declarations are redefined in ADSIID.lib! Because the program needs this lib to work right i even can't let it be. Then i found out that this sometimes happens, god knows why!, and that i should insert the prefix "/force:multiple" into the menu project\settings\Link\"Project Options". I did so and the result was a list like the following, please don't scare:
Generating Code...
Linking...
LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification
uuid.lib(guids.obj) : warning LNK4006: _DBGUID_SQL already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBGUID_DEFAULT already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBGUID_DBSQL already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_VIEW already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_PROPERTIESINERROR already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_DBINITALL already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_SESSIONALL already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_SESSION already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_ROWSETALL already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_DATASOURCEINFOALL already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_DATASOURCEALL already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_TABLE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_ROWSET already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_INDEX already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_DBINIT already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_DATASOURCEINFO already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_DATASOURCE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBPROPSET_COLUMN already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _PSGUID_QUERY already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOL_SPECIALCOL already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOL_SELFCOLUMNS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_PROCEDURE_COLUMNS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_PRIMARY_KEYS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_FOREIGN_KEYS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_PROCEDURE_PARAMETERS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_VIEW_TABLE_USAGE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_VIEW_COLUMN_USAGE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_VIEWS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_PROVIDER_TYPES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_TRANSLATIONS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_TABLES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_STATISTICS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_SQL_LANGUAGES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_SCHEMATA already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_PROCEDURES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_USAGE_PRIVILEGES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_TABLE_PRIVILEGES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_COLUMN_PRIVILEGES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_INDEXES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_COLUMN_DOMAIN_USAGE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_TABLE_CONSTRAINTS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_REFERENTIAL_CONSTRAINTS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_KEY_COLUMN_USAGE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_CONSTRAINT_TABLE_USAGE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_CONSTRAINT_COLUMN_USAGE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_CHECK_CONSTRAINTS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_COLUMNS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_COLLATIONS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_CHARACTER_SETS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_CATALOGS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_ASSERTIONS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _MDSCHEMA_MEMBERS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _MDSCHEMA_PROPERTIES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _MDSCHEMA_MEASURES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _MDSCHEMA_LEVELS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _MDSCHEMA_HIERARCHIES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _MDSCHEMA_DIMENSIONS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _MDSCHEMA_CUBES already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBGUID_MDX already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _MDGUID_MDX already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBSCHEMA_TABLES_INFO already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_MAYSORT already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_CLSID already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_COLUMNSIZE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_OCTETLENGTH already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_NUMERICPRECISIONRADIX already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_DATETIMEPRECISION already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_DOMAINSCHEMA already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_DOMAINCATALOG already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_TYPEINFO already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_PROPID already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_GUID already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_BASESCHEMANAME already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_BASECATALOGNAME already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_ISUNIQUE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_ISSEARCHABLE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_ISCASESENSITIVE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_ISAUTOINCREMENT already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_HASDEFAULT already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_DOMAINNAME already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_DEFAULTVALUE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_COMPUTEMODE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_COLLATINGSEQUENCE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_BASETABLENAME already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_BASECOLUMNNAME already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_FLAGS already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_SCALE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_PRECISION already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_TYPE already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_NUMBER already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_NAME already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DBCOLUMN_IDNAME already defined in ADSIID.lib(guid.obj); second definition ignored
uuid.lib(guids.obj) : warning LNK4006: _DB_NULLID already defined in ADSIID.lib(guid.obj); second definition ignored
Debug/Authenticate.exe : warning LNK4088: image being generated due to /FORCE option; image may not run
Authenticate.exe - 0 error(s), 96 warning(s)
But it works; at the first glance!
I thought i can't go on; but wrong!
I dont't know how the first three parameters of the function
HRESULT ADsOpenObject(
LPWSTR lpszPathName,
LPWSTR lpszUserName,
LPWSTR lpszPassword,
DWORD dwReserved,
REFIID riid,
VOID FAR * FAR *ppObject
);
should look like! I have already watched the MSDN but the information in there isn't enough for me! Please help me!!!
|
|
|
|
|
Hey Guys
I have a function in a dll i call with rundll32.exe when i double click a file and i was wondering how i get the filename of the file that has been double clicked.
Cheers
Peter
|
|
|
|
|
Check:
CFile::GetFileName
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
|
Yeah Thats exactly it
Thanks
|
|
|
|
|
I'm trying to make a little dialog to let the user search for a text string in a CEdit control on my main app's dialog. Like in Word or Notepad those kind of search windows. Does anyone have an idea on how to do this because i tried something myself and it didn't work at all (one of the reasons is that the CEdit::SetSel(...) didn't appear to work.)
Thanks
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
Kuniva wrote:
i tried something myself and it didn't work at all
It's better to mention what did you do
Kuniva wrote:
search for a text string in a CEdit control
Why don't you change it to RichEdit control,
it has more feature for text.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi,
I have a .icm file.I would like to retreive the contents of the tag whose signature is "desc".
Any idea?
Neha
|
|
|
|
|
I jus opened a few icm files. They are not text files. They contain binary data and the postition of the description kept changing file to file, so did the file size. I suggest that you do a search to figure out the icm internal structure.
Nish
It's seven o'clock
On the dot
I'm in my drop top
Cruisin' the streets - Oh yeah
I got a real pretty, pretty little thing that's waiting for me
|
|
|
|
|
I have some code for this that I d/led online somewhere, but it's at work. I'll post the link when I get back to the office on Monday.
Yeah I know, get a VPN right? Oops!
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
|
|
|
|
|
|
I have a need to do the following item and could use some help setting it up. I have a basic MFC application running that includes a prebuilt MFC dialog derived class for allowing the user to input data. this all works fine. I need, however, to allow the user to create their own MFC based dialog box, and then allow them to call that dialog box at runtime without the primary application being aware of the dialogs design. So what I have done is this...
in main app, when i select menu item 'test' it looks for a dll named 'testing.dll', and if it finds it, then it loads the dll, finds a function called Create() and attempts to run it. this works fine.
in the create() function, it is a simple test for now.
char gString[255] = "";
void Create()
{
CMyDialog d;
if (d,DoModal() == IDOK)
strcpy(gString,"everything worked fine");
}
all of the exporting works fine, it does loading the dll, finding the create function, retrieving the gString variable etc... the only thing that doesnt work as expected, is in the DoModal() call of the dialog class. the dialogbox appears, and then the entire program crashes. This doesnt happen if i create a simple dialog box that is not CDialog derived.
Am I missing something on MFC? is there an issue with trversing a dll boundary with the MFC.
thanks in advance for any info.
|
|
|
|
|
Anonymous wrote:
CMyDialog d;
if (d,DoModal() == IDOK)
strcpy(gString,"everything worked fine");
This won't work.
You have not associated a dialog resource. Without doing that DoModal() will fail.
Nish
It's seven o'clock
On the dot
I'm in my drop top
Cruisin' the streets - Oh yeah
I got a real pretty, pretty little thing that's waiting for me
|
|
|
|
|
sorry but i am not sure what you mean exactly.
In the dll I created, there is a class definition of an MFC CDialog derived class. I should have written this from home, I will post my code when i get there. but the class 'should' be all inclusive, as it runs fine in a native MFC application. anyhow, when i get the code posted maybe my question will make more sense
|
|
|
|
|
Oh!
I apologize for misinterpreting your question.
Yes, please post a little more code, so that it might be easier to locate the problem.
Thanks
Nish
It's seven o'clock
On the dot
I'm in my drop top
Cruisin' the streets - Oh yeah
I got a real pretty, pretty little thing that's waiting for me
|
|
|
|
|
Is testing.dll an 'extension dll'? If you're creating a dll which uses MFC, you have three options - DLL using static MFC, 'regular' DLL using MFC in DLL and 'extension' DLL which shares MFC data with your .exe file and with other 'extension' dlls.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
ok, a little code to go with this mess I have
// ******************************************************************
// MFCTestDll4.dll is a MFC extension dll.
#define MFCTESTDLL4_API __declspec(dllexport)
// used for determining of dll contains deObject definitions
extern "C"
{
MFCTESTDLL4_API char* GetData();
MFCTESTDLL4_API void SetData(char* data);
MFCTESTDLL4_API void CreateMyDialog(char* name);
}
// **********************************************************************
// the dll code is like this
// MFCTestDLL4.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include <afxdllx.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
static AFX_EXTENSION_MODULE MFCTestDLL4DLL = { NULL, NULL };
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("MFCTESTDLL4.DLL Initializing!\n");
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(MFCTestDLL4DLL, hInstance))
return 0;
// Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result.
new CDynLinkLibrary(MFCTestDLL4DLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("MFCTESTDLL4.DLL Terminating!\n");
// Terminate the library before destructors are called
AfxTermExtensionModule(MFCTestDLL4DLL);
}
return 1; // ok
}
#include "MFCTestDLL4.h"
#include "testdialog4.h"
#include "DE3DUtils.h"
char gData[10000] = "testing the data stream";
MFCTESTDLL4_API char* GetData()
{
Log("Inside DLL, GetData()");
return gData;
}
MFCTESTDLL4_API void SetData(char* data)
{
Logf("Inside DLL, SetData(%s)",data);
strcpy(gData,data);
}
MFCTESTDLL4_API void CreateMyDialog(char* name)
{
Logf("Inside DLL, CreateMyDialog(%s)",name);
TestDialog4 t;
Log("Inside DLL, TestDialog t");
if (t.DoModal() == IDOK)
{
Log("Inside DLL, DoModal == IDOK");
SetData("Hello world we picked the idok button");
}
Log("Inside DLL, After dialog");
}
// **********************************************************************
// now, in my main app i do this
// find the dialog dll
// attempt to load the dll
char filename[255] = "resourcedll\\MFCTestDLL4.dll";
HMODULE hwnd = LoadLibrary(filename);
if (!hwnd)
{
// something went wrong when loading the DLL
Log("Unable To Load Resource Library",filename);
return;
}
else
{
// we have a good library to use
Log("Resource Library Loaded",filename);
}
// set the data
typedef void (*SETDATA)(char*);
SETDATA SetDataProc = (SETDATA) GetProcAddress(hwnd, "SetData");
if (!SetDataProc)
{
Log("Unable to locate SetData Function");
return;
}
else
{
Log("SetData Function located");
SetDataProc("from the main app");
}
// run the dialog
typedef void (*CREATEMYDIALOG)(char*);
CREATEMYDIALOG CreateMyDialogProc = (CREATEMYDIALOG) GetProcAddress(hwnd, "CreateMyDialog");
if (!CreateMyDialogProc)
{
Log("Unable to locate CreateMyDialog Function");
return;
}
else
{
Log("CreateMyDialog Function located");
CreateMyDialogProc("TestDialog");
}
// get the data
typedef char* (*GETDATA)();
GETDATA GetDataProc = (GETDATA) GetProcAddress(hwnd, "GetData");
if (!GetDataProc)
{
Log("Unable to locate GetData Function");
return;
}
else
{
Log("GetData Function located");
char s[255];
strcpy(s,GetDataProc());
}
// **********************************************************************
// after all of this, my log file looks like this...
Resource Library Loaded - resourcedll\MFCTestDLL4.dll
SetData Function located - (null)
Inside DLL, SetData(from the main app) - (null)
CreateMyDialog Function located - (null)
Inside DLL, CreateMyDialog(TestDialog) - (null)
Inside DLL, TestDialog t - (null)
// and i get a nice little windows messagebox telling me i screwed up
as you can see from the log file, it is during the DoMocal() call that I have the trouble.
any thoughts?
|
|
|
|
|
The Problem is --Where and How to Delete the created objects with "new" Operator
Please mark the palce and solution..
i tried with somany ways but i am getting "Heap assertion"
and in Debugging mode it is showing MemoryLeak Detected
as follows:
Detected memory leaks!
Dumping objects ->
{172} normal block at 0x002F5F88, 500 bytes long.
Data: <d:\projects\dump> 44 3A 5C 50 72 6F 6A 65 63 74 73 5C 44 75 6D 70
and also i am getting the
First-chance exception in MyApp.exe (KERNEL32.DLL): 0x000006B5: (no name).
please give me the solution
I am very much worring about these problems please please....
This is Mycode:
I am declaring structures as follows:
1.For Database entries:
;;;;;;;;;;;;;;;;;;;;;;;
typedef struct{
char strName[MAX_PATH];
int nNumber;
int nCode;
}DB_DATA;
2:For Daily entries:
;;;;;;;;;;;;;;;;;;;;
typedef struct{
char strName[MAX_PATH];
int nNumber;
int nCode;
}DAILY_DATA;
Now i am using CTypedPtrList as follows:
1.For Database:
===============
typedef CTypedPtrList<cptrlist,db_data*> DB_DATA_LIST;
DB_DATA_LIST m_lstDbData;
2.For Initial List:
==================
typedef CTypedPtrList<cptrlist,daily_data*> INITIAL_LIST;
INITIAL_LIST m_InitialList;
3.For Priority List:
====================
typedef CTypedPtrList<cptrlist,daily_data*> PRIORITY_LIST;
PRIORITY_LIST m_PriorityList;
Initially i am getting all the data from database and store it in "m_lstDbData"
as follows:
############
while (EndOfFile)
{
DB_DATA * dbdata=new DB_DATA;
strcpy(dbdata->sName,rs.sName);
dbdata->nNumber=rs.nNumber;
dbdata->nCode=rs.nCode;
m_lstDbData.AddTail(dbdata);
MoveNext();
}
Preparing the InitialList as follows:
`````````````````````````````````````
Now i am checking the Dialy Register(one Text file contains record wise data) if
Daily Register values mactched with Database values then stored this values into InitialList.
do
{
POSITION nPos=m_lstDbData.GetHeadPosition();
for(int nPass=0;nPass<m_lstdbdata.getcount();++npass)
{=""
="" db_data="" *="" tempdbdata="new" db_data;="" if(dialyreg="" ncode="=tempDbdata-">nCode)
{
DAILY_DATA * tempDailyData=new DAILY_DATA;
strcpy(tempDailyData->sFileName,str);
tempDailyData->nNumber=tempDbdata->nNumber;
tempDailyData->nCode=tempDbdata->nCode;
InitialList.AddTail(tempDailyData);
}//end if(DialrRegCode==tempDbdata->nCode)
m_lstDbData.GetNext(nPos);
}//end for(int nPass=0;nPass<m_lstdbdata.getcount();++npass)
="" }while(endof="" daily="" reg);="" this="" is="" do="" while="" loop=""
<<<<<<<<<<<<<<<<<<<<<<<<<="">>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Next I am preparing PriorityList according the nCode(assending):
````````````````````````````````````````````````````````````````````
while(!InitialList.IsEmpty())
{
POSITION nPos=InitialList.GetHeadPosition();
DAILY_DATA * TempHeadPosData=new DAILY_DATA;
TempHeadPosData=InitialList.GetAt(nPos);//Head Position Priority
nStuctPos=InitialList.Find(TempHeadPosData);
nHPosCode=TempHeadPosData->nCode;
for(int nIndex=0;nIndex<initiallist.getcount();nindex++)
{
="" daily_data="" *="" tempnextposdata="new" daily_data;
="" nnextposcode="TempNextPosData-">nCode;
if(nHPosCode>nNextPosCode)
{
nStuctPos=InitialList.Find(TempNextPosData);
int nTempHold=nHPosCode;
nHPosCode=nNextPosCode;
nNextPosCode=nHPosCode;
}//end if(nHPosCode>nNextPosCode)
else
{
if(nHPosCode==nNextPosCode)
{
//here i am doing somethine
}//end if(nHPosCode==NextPosPriority)
}//end else
}//end for(int nIndex=0;nIndex<initiallist.getcount();nindex++)
="" daily_data="" *="" tempnewdata="new" daily_data;
=""
="" prioritylist.addtail(tempnewdata);
="" initiallist.removeat(nstuctpos);
="" }="" end="" while(!initiallist.isempty())
finally="" i="" am="" getting="" the="" data="" from="" prioritylist="" and="" send="" it="" to="" mydll(mydll="" do="" update="" database)=""
``````````````````````````````````````````````````````````````````````````````````````````````````
while(!prioritylist.isempty())
="" {
="" position="" pos="PriorityList.GetHeadPosition();
" filedata="new" strtemp.format("%s",filedata-="">szName);
nCode=filedata->nCode;
if(nCode>=1)
{
//call MyDll
PriorityList.RemoveAt(Pos);
}//end if(nCode>=1)
else
{
PriorityList.RemoveAt(Pos);
}
strTempPath=strPath;
}//end while(!PriorityList.IsEmpty())
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Now the Problem is --Where and How to Delete the created objects with "new" Operator
Please mark the palce and solution..
i tried with somany ways but i am getting "Heap assertion"
and in Debugging mode it is showing MemoryLeak Detected
as follows:
Detected memory leaks!
Dumping objects ->
{172} normal block at 0x002F5F88, 500 bytes long.
Data: <d:\projects\dump> 44 3A 5C 50 72 6F 6A 65 63 74 73 5C 44 75 6D 70
and also i am getting the
First-chance exception in MyApp.exe (KERNEL32.DLL): 0x000006B5: (no name).
please give me the solution
I am very much worring about these problems please please....
anju
|
|
|
|
|
hi:
how to get the whole URLs form the intetnet shortcuts(the file in c:\windows\history)?
Thanks
benben
|
|
|
|
|