Re: Cannot open include file:problem with Dll header
- From: "priyanka" <priyanka.surjan@xxxxxxxxx>
- Date: 21 Nov 2006 18:49:42 -0800
Thanks for all valubale comment but still my problem is same....not
solved...
Joseph M. Newcomer のメッセージ:
Absolutely this is one of the worst possible solutions.
KEEP YOUR DLLs OUT OF THE SYSTEM32 FOLDER!!!!!
Not only does this create problems where you might overwrite a DLL of the same name, or
have a DLL of the same name overwrite yours, but in many real environments the System32
folder is locked down and not only cannot be written to, but often changes are expunged as
potential security threats. I've worked in these environments. (In fact, in one
environment, if a "foreign" DLL, that is, one not on the corporate-approved list, is found
in your System32 folder, your machine is mapped out of the network for security reasons,
and only someone from security operations can authorize putting it back in, AFTER the DLL
is removed).
Any solution that involves putting your own DLLs in the System32 folder should be
automatically labelled "UNACCEPTABLE".
Putting the DLL in the System32 folder is COMPLETELY UNRELATED TO USING A HEADER FILE! THE
TWO CONCEPTS HAVE ABSOLUTELY ****NOTHING**** TO DO WITH EACH OTHER!!!
Putting the declaration in the C/C++ source module is a very "retro" step; it says "I'd
rather do it wrong than right". Header files exist for a reason, which is to keep one
single definition point in sync with the actual module. It is Very Bad Practice to simply
declare the functions as extern in the module makes maintenance extremely difficult, if
not impossible, and adds the possibility that you will have seriously malfunctioning
software. For example, it will compile and link, and work fine until the "error" path is
taken that calls a function whose actual implementation has changed, at which point the
program does something really exciting like take an access fault. Assume that any
practice that does NOT use header files should be labelled "UNACCEPTABLE".
Sloppy programming to avoid correct solutions is UNACCEPTABLE. This is just being lazy. Do
the job right. Nothing proposed here is even marginally acceptable programming practice.
This proposal is somewhere between laughable and dangerous and fundamentally point 3 makes
no sense at all!!!!
If I employed a programmer who did this more than once, said programmer would be in search
of new employment. One warning, and one warning only. Developing bad habits like this, or
even suggesting them, is irresponsible.
joe
On 19 Nov 2006 19:43:33 -0800, "vishal.g.shah@xxxxxxxxx" <vishal.g.shah@xxxxxxxxx> wrote:
Joseph M. Newcomer [MVP]
there is one more solution to this you can use
extern "C" _declspec(dllimport) void fn_in_dll();
// prototype of fn to be used fm dll in your code
// fn_in_dll is the name of fn u defined in dll
and add the path of lib file to
1)project ->settings ->link ->input ->additional lib paths .
2) copy your dll into the system 32 folder of your C drive
3) now u can use the dll function in your code without requiring to add
any header file?
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Cannot open include file:problem with Dll header
- From: priyanka
- Re: Cannot open include file:problem with Dll header
- From: vishal.g.shah@xxxxxxxxx
- Re: Cannot open include file:problem with Dll header
- From: Joseph M . Newcomer
- Cannot open include file:problem with Dll header
- Prev by Date: Re: ClipCursor trouble
- Next by Date: Re: ClipCursor trouble
- Previous by thread: Re: Cannot open include file:problem with Dll header
- Next by thread: custom colors in dialogbars
- Index(es):
Relevant Pages
|