 |
|
 |
I spent Days looking for a good tutorial about using 7zip.DLL to implement compression in VC++ 2010 MFC application. I'm still at step one i.e. How to use Open source DLLs in VC++. This Module is one of the parts of my project. Please Help me or point me to the right direction. I'm Running out of time...
|
|
|
|
 |
|
|
 |
|
 |
Do you have any hint?
- I have a MFC Regular DLL with the code I want to share from one MFC Dialog to be used by a non MFC application.
- In the same project space I have created a non MFC Client application that will use the public interface of this DLL for testing the DLL (Just a plain console application).
- To make the testing more close to the real world, I have copied the *.dll/*.lib to the TestConsole directory
How do you run the debugger into the code of the DLL?
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
 |
|
 |
you must build the dll in debug mode and than you should step into it.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
 |
|
 |
I'm getting this error, when trying to put the strName to "Hello "! It give's the same, if I try to switch them too. I's funny but it's true!!!
Can anybody tell me why is that??? I've never seen some basic thing generate error like that!
|
|
|
|
 |
|
 |
Code crashes if the dll links statically to MFC
void CTestDLLDlg::OnOK()
{
UpdateData(true);
CString strResult = objMyClass.SayHello(m_edit);
AfxMessageBox (strResult);
//CDialog::OnOK();
}<- when strResult goes out of scope the attempt to release its memory causes an assertion error
|
|
|
|
 |
|
 |
I get this error on compiling the test app - error C2146: syntax error : missing ';' before identifier 'objMyClass' I did everything exactly in the example provided. Is this a problem with dll export ?
Eric H
|
|
|
|
 |
|
 |
it works excelent, saludos desde MEXICO
|
|
|
|
 |
|
 |
this works great from MFC appl. Anyone try from a standard vb.net 2005?
|
|
|
|
 |
|
 |
I get unsatisfied externals (the class & its 1 funcion) when I try to link.
Im using VS .NET 2003.
I added '..\MyDll\Release\MyDll.lib' to:
project properties->Linker->General->additional lib modules.
Does anyone know ?
|
|
|
|
 |
|
 |
The reference to the '.lib' file is placed in 'additional dependancies', NOT 'additional lib modules'.
duh
|
|
|
|
 |
|
 |
I want to convert a console program(vc project) to an reusable dll
The console program gives output which can be piped and can be parsed to get desired values.
But it is more desirable if i can convert this console program to reusable dll
Santosh Vispute
|
|
|
|
 |
|
 |
Hi, can anybody tell me, why I'm getting -
"The procedure entry point ? SayHello@CMyClass@@QAEHHH@Z could not be located in the dynamic kink libraryMyDll.dll" -
this error when I try to run Release EXE of TestDll..???
What does it mean actually?
Jay
|
|
|
|
 |
|
 |
It could be that you are trying to register a .NET dll. They don't need to be registered in the same way. Try using Regasm.exe for .NET dll.
|
|
|
|
 |
|
 |
It could be that you are trying to register a .NET dll. They don't need to be registered in the same way. Try using Regasm.exe for .NET dll.
|
|
|
|
 |
|
 |
Hello, I wanna create and use a dll which uses ODBC classes (CDababase, CRecordset, etc).
I got the dll without problems and I have done what this article says to export methods.
The problem is that, in the application (dll client) when compiling I got an error wich says CRecordSet base class without definition.
Any solution?
Lots of thanks.
|
|
|
|
 |
|
 |
Hi,
You have witten in step 2 (Creating the Dll):
>>Let the default selection for DLL type remain, i.e "Regular DLL using Shared MFC DLL"<<
What happens if I choose "Use MFC in a static library"?
I get "Debug Assertion Failed!" message in SayHello function:
CString CMyClass::SayHello(CString strName)
{
//Return the input string with a Hello prefixed
return "Hello " + strName; // debug assertion failed!!!
}
The debugger shows that CString::~CString() fails.
But WHY???
Pleeeease help me!
Frankie
|
|
|
|
 |
|
 |
Solution:
"Add the following line of code to the beginning of every function exported from the DLL: AFX_MANAGE_STATE(AfxGetStaticModuleState())"
http://support.microsoft.com/kb/140850/EN-US/
|
|
|
|
 |
|
 |
I have some problem with inpout32.dll
in win32 console application project my code is:
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
/* ----Prototypes of Inp and Outp--- */
void _stdcall Out32(short PortAddress, short data);
/*--------------------------------*/
/*
int main()
{
Out32(888,20);
return 0;
}
but in MFC project ,it error (i use the same code ,except
int out()
{
Out32(888,20);
return 0;
}
Linking...
thulpt1Dlg.obj : error LNK2001: unresolved external symbol "void __stdcall Out32(short,short)" (?Out32@@YGXFF@Z)
Debug/thulpt1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
thulpt1.exe - 2 error(s), 0 warning(s)
how can i solve it ?
please help me
dnqhung
|
|
|
|
 |
|
 |
why the function of this dll can't be load with GetProcess???
|
|
|
|
 |
|
 |
hiii,
i am building a mfc shared dll using .net and i don't know how to use it in c#.net. i look at your code but it using c++/mfc too. well i am using c#.net
please help me if you have some idea.
below is the code generated by .net wizard for creating mfc shared dll :
---cblueftpclass.h---
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
// CblueftpclassApp
// See blueftpclass.cpp for the implementation of this class
//
class CblueftpclassApp : public CWinApp
{
public:
CblueftpclassApp();
// Overrides
public:
virtual BOOL InitInstance();
DECLARE_MESSAGE_MAP()
};
---cblueftpclass.cpp---
// blueftpclass.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include "blueftpclass.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
//
// Note!
//
// If this DLL is dynamically linked against the MFC
// DLLs, any functions exported from this DLL which
// call into MFC must have the AFX_MANAGE_STATE macro
// added at the very beginning of the function.
//
// For example:
//
// extern "C" BOOL PASCAL EXPORT ExportedFunction()
// {
// AFX_MANAGE_STATE(AfxGetStaticModuleState());
// // normal function body here
// }
//
// It is very important that this macro appear in each
// function, prior to any calls into MFC. This means that
// it must appear as the first statement within the
// function, even before any object variable declarations
// as their constructors may generate calls into the MFC
// DLL.
//
// Please see MFC Technical Notes 33 and 58 for additional
// details.
//
// CblueftpclassApp
BEGIN_MESSAGE_MAP(CblueftpclassApp, CWinApp)
END_MESSAGE_MAP()
// CblueftpclassApp construction
CblueftpclassApp::CblueftpclassApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
// The one and only CblueftpclassApp object
CblueftpclassApp theApp;
// CblueftpclassApp initialization
BOOL CblueftpclassApp::InitInstance()
{
CWinApp::InitInstance();
return TRUE;
}
please if you have some idea. thx. alot.
regards,
-xins
|
|
|
|
 |
|
 |
You have to have your class defined so that __declspec(dllexport) is used for the dll and __declspec(dllimport) is used for the code that calls this.
You generally do this with a macro.
class MYDLL_CLASS_EXPORT CMyClass
{
public:
CString SayHello (CString strName);
CMyClass();
virtual ~CMyClass();
};
And then in a common header file define the macro as:
#if defined(MYDLL_STATIC)
#define MYDLL_CLASS_EXPORT
#elif !defined(MYDLL_DLL)
#define MYDLL_CLASS_EXPORT __declspec(dllimport)
#else
#define MYDLL_CLASS_EXPORT __declspec(dllexport)
#endif
Then in the C++ project settings for the dll only define MYDLL_DLL as a preprocessor macro. This way __declspec(dllexport) will be used in the dll and __declspec(dllimport) will be used in the calling program.
[EDIT]
See this post for more info: http://www.codeproject.com/dll/BeginnerDLL.asp?msg=624896#xx624896xx[^]
[/EDIT]
John
|
|
|
|
 |
|
 |
On executing Imran's Code i get a message
linker error:c:\Program.obj not found
please help.
---i like to ask----
|
|
|
|
 |
|
 |
I was getting the following error:
"The procedure entry point ??0CmyClass@@QAE@XZ could not be located in the dynamic link library MyDll.dll"
But the program worked fine when i changed "Object/library" modules in Project->Settings->Link to "..\MyDll\Debug\MyClass.obj"
So whats the difference here between linking to .lib file and linking to .obj file
Can someone give a hint???
|
|
|
|
 |
|
 |
jithus wrote:
So whats the difference here between linking to .lib file and linking to .obj file
I may be incorrect but I believe linking to the .obj will be not using the dll at all.
John
|
|
|
|
 |