|
Hi Everybody,
1.What are relocatable dlls exactly?
2.Under what condition one had to use them?
3.How they differ from standard Windows DLL
Thanks
Abhi Lahare
|
|
|
|
|
Hi there,
1) a DLL normally contains information about where the OSLoader has to map it into the Adress space of an application. If the space is already occupied the system needs to relocate the handle of the Library so it can execute properly.
2) actually you don't have to use them, cuase the system does it for you
3) this depends on the Dll, but normally they should differ that much
|
|
|
|
|
Me again,
maybe you want to download and install Sysinternals Process Explorer. It has a view for the modules loaded by an application and you will be able to observe relocated dll's as well.
|
|
|
|
|
hi,
i am facing some problem ,while retriving the resource from dll. That dll is a "esource only dll". Here is the code,what i am using.
HMODULE hmod;
HRSRC hr;
/*here testdll.dll is the dll created for testing purpose and it has bitmap1.bmp resource*/
hmod=::LoadLibrary("testdll.dll");
hr=::Findresource(hr,"bitmap1.bmp",RT_BITMAP);
if(hr==NULL)
MessageBox("This is not working");
else
MessageBox("This is Working");
This is code i have written ,but when ever i run,i get only "This is not working" messagbox. This is means we unable to get the resource from dll.
Can you suggest me, possible solution
regards,
Ram
Spend Every Minute for Success
|
|
|
|
|
sory, its just a little mistake
in above code ,i have done little mistake. The actual code what i am using is..
HMODULE hmod;
HRSRC hr;
hmod=::LoadLibrary("testdll.dll");
hr=::FindResource(hmod,"bitmap1.bmp",RT_BITMAP);
if(hr==NULL)
MessageBox("This is not working");
else
MessageBox("This is Working");
This is code i have written ,but when ever i run,i get only "This is not working" messagbox. This is means we unable to get the resource from dll.
Can you suggest me, possible solution
Spend Every Minute for Success
|
|
|
|
|
You cannot reference the resource by its name ("bitmap1.bmp"). You have to pass its resource identifier to FindResource. Refer to your resource.h, to find out which identifier was assigned to it and use this call:
hr = ::FindResource ( hmod, MAKEINTRESOURCE(%YOUR_IDENTIFIER_HERE%), RT_BITMAP );
|
|
|
|
|
kotiramkoteswararao wrote: Can you suggest me, possible solution
here this link will help :-
http://www.codeproject.com/cpp/UpdateResource.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
When i create a modeless dialog, which pops a modal dialog then, the application will crash when i end the application with these dialogs stay opened.
-- modified at 0:01 Tuesday 20th December, 2005
|
|
|
|
|
How can you close your application when a modal dialog is open? Or is your application crashing when you close it when the modeless dialog stay open?
To use modeless dialog in application make a modeless dialog pointer as a member of your mainframe class. Here is the sample code for using modeless dialog box
class CModeless: public CDialog
{
// Construction
UINT m_nID;
CWnd* m_pParent;
public:
CModeless(CWnd* pParent = NULL): CDialog(CModeless::IDD, pParent)//standard constructor
{
m_nID=CModeless::IDD;
m_pParent=pParent;
}
BOOL Create()
{
return CDialog::Create(m_nID,m_pParent);
}
// Dialog Data
//{{AFX_DATA(COptionDllDlg)
enum { IDD = IDD_DIALOG_MODELESS };
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COptionDllDlg)
protected:
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(COptionDllDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
afx_msg void OnDestroy();
afx_msg void OnClose();
};
void CModeless::OnDestroy()
{
((CMainFrame *) AfxGetMainWnd())->ModelessDlgDone();
CDialog::OnDestroy();
}
void CModeless::OnClose()
{
((CMainFrame *) AfxGetMainWnd())->ModelessDlgDone();
CDialog::OnClose();
}
void CModeless::PostNcDestroy()
{
delete this;
((CMainFrame *) AfxGetMainWnd())->ModelessDlgDone();
// CDialog::PostNcDestroy();
}
And In mainframe class add the following members
CModeless *m_pModelessDlg;
CModeless *ShowModelessDlg();
void ModelessDlgDone();
initialize m_pModelessDlg to NULL in the constructor
CMainFrame::CMainFrame():m_pModelessDlg(NULL)
{
...
}
CModeless *CMainFrame::ShowModelessDlg()
{
if (m_pScaleDlg==NULL)
{
m_pModelessDlg=new CModeless(this);
m_pModelessDlg->Create();
m_pModelessDlg->ShowWindow(SW_SHOW);
}
else
{
m_pModelessDlg->ShowWindow(SW_SHOW);
}
return m_pModelessDlg;
}
void CMainFrame::ModelessDlgDone()
{
m_pModelessDlg=NULL;
EnableWindow();
}
CMainFrame::~CMainFrame()
{
if (m_pModelessDlg)
{
m_pModelessDlg->DestroyWindow();
m_pModelessDlg=NULL;
}
}
|
|
|
|
|
Iam working on a module whose functionality is to connect UPS (Uninterupted Power Supply) to PCS USing WIndows MAnagement Instrumentation . Can U please Suggest How To Proceed With This .
abhi
|
|
|
|
|
I am working with embedded systems but i dont know
if there is any special service provided by windos
to manage a UPS .
But we have done such things with the help of Parallel
port.
If u get such information do put it up on the Codeproject
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
hello,
i write a control of word,and want to control the print of the word doc,and i learn can capture the beforeprint event of the word app object,but i do not know how to do it in visual c++,who can help me?
thanks.
|
|
|
|
|
|
Hi everybody
I have an instance of the IWebBrowser2 interface implemented by the internet explorer, and i need to know, how i can enable the block popups function.
|
|
|
|
|
Try this...
http://www.codeproject.com/tools/OxFF.asp[^]
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi everybody,
Let me introduce myself. My name is Quang Dien, a Vietnamese students. This term, I have to do a project about the fingerprint detecting.
About my profect, I had a source code on MATLAB, it can run on MATLAB perfectly. But, my program is written by VC++ 6.0, so, I have to use MATLAB COM Builder to build a component to use in VC++. I use MATLAB 6.5 R13 comtool to build it. "Standalone built completed !" , no problems. But, when I call it in VC++, no thing happen ! No error but no reaction. The input parameter is the same with itself when initializing. About my function, I can summarize for you as below :
Function score = cubs_match(input_file1, input_file2)
where :
input_file1 : the string holds the path to the fingerprint image1
input_file2 : the string holds the path to the fingerprint image2
score : a number between 0 to 100, show how much do 2 fingerprint images look like rach others.
When I built it, I use VC++ 6.0 call it as below :
// --> Set the input arguments to the COM method
VARIANT f1_Variant, f2_Variant;
VariantInit(&f1_Variant);
f1_Variant.vt = VT_BSTR;
f1_Variant.bstrVal = SysAllocString(L"C:/MATLAB6p5/work/Fingerprint/1_1.fp");
VariantInit(&f2_Variant);
f2_Variant.vt = VT_BSTR;
f2_Variant.bstrVal = SysAllocString(L"C:/MATLAB6p5/work/Fingerprint/1_2.fp");
// --> Set the output arguments to the COM method
VARIANT result;
// --> Create an instance of the COM object
IFingerprintClass *pImyclass;
hr=CoCreateInstance(CLSID_FingerprintClass,NULL, CLSCTX_INPROC_SERVER, IID_IFingerprintClass, (void **)&pImyclass);
// --> Access the method with arguments and receive the output out1
hr = (pImyclass -> cubs_match(1, &result, f1_Variant, f2_Variant));
// --> Print the result
CString Show_Screen;
Show_Screen.Format("Matching score : %g",result.dblVal );
MessageBox(Show_Screen);
Note : + My component has the name as "Fingerprint" and the Class name is "FingerprintClass"
+ The *.fp format is my own format.
But when run it, the result doesn't change. It return : -9.25596e+061
What is my problem ? How to solve it ? Please kindly answer for me if you know about my problems ...
Thanks a lot.
Best regards,
Quang Dien
____________________
PS : + Please reply your ans to me to : quangdien12jan@yahoo.com
+ About the Fingerprint Toolbox, you can download it form mathworks.com, search for "fingerprint recognition toolbox"
|
|
|
|
|
hi all, i have a question about using global anonymous unions in more than one .cpp file.
if i have this code:
static union {int y; int z;};
in one of my source files, how do i declare it in a header file so it can be used elsewhere.
These approaches do not work:
extern static union {int y; int z;};<br />
extern union {int y; int z;};<br />
extern int y; extern int z;
If I take the 'static' off, i get the following message:
test.cpp(9) : error C2646: global anonymous unions must be declared static
But static means internal linkage, so does that mean this is impossible?
Thanks in advance,
John
|
|
|
|
|
What exactly u mean the approch dont work
it gives error or it dont work logically .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hey man what was the problem i didnot get any reply
i have tired it with my vc6 compiler it works fine
with my program .
I dont seeem any problem in it
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
the problem is i can only use one storage-class specifier, but static is required so i can't use extern. this current method works fine if i only need to access it through one source file, but my project has many source files and requires the members of this union to be accessed through many of those files. here is my current code, please post yours that works:
extern union {int y; int z;};<br />
<br />
#include "main.h"<br />
<br />
void do_something() {<br />
y = z;<br />
}<br />
<br />
static union {int y; int z;};<br />
<br />
void main() {<br />
do_something();<br />
}
i appreciate it,
John
|
|
|
|
|
why using an anonymous union ?
just give it a name !!
extern union myUnion {
int x;
int y;
};
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
-- modified at 4:18 Tuesday 20th December, 2005
|
|
|
|
|
Yeh TOXCCT
Giving a name is good.
but an anonymous union also dont create any
issue , i tired and checked it out in my
project.
It works fine .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
where is the name??? did u mean
extern union myUnion
{
int x; int y;
}mu;
is this ok?
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1"> --[V]--
|
|
|
|
|
|
mon cher ami,
ca va? je fais bein ici. (ok lets not squeeze my brain to get those french words out ) how's chirstmas preparations going on? is it full of snow? you ski? skate?
spend lot of time with your coupine?? what's going to be your gift for her this xmas???
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1"> --[V]--
|
|
|
|