|
As Cedric said, what's so bad about giving headers? One way or another, their code needs to know how to talk to yours, and the secret of all your dodgy function names will be revealed.
That said...
Some companies I use just distribute the DLLS. I then use #import to get the COM interfaces from those. But that is COM, and Typelibs, and all sorts of fun... Chances are its more headache than its worth, but it does let their DLLS be used from many languages, include VB. *I* don't care about that, but you might.
Iain.
|
|
|
|
|
can #pragma comment(lib, "libname.lib") help??
|
|
|
|
|
That's only to specify that you link to the lib file. You still don't know how the exported classes look like.
|
|
|
|
|
If you don't want the client to use the exported classes directly from the dll, you can.
If the client uses the DLL directly, the exposed classes needs to have its declaration exposed right.
If you really want to hide the class declaration that might have some implementation exposed, provide only interface exposed to it similar to COM concepts.
|
|
|
|
|
Just a thought (may not work), but if your DLL is simple enough and doesn't require any specific definitions (i.e. structures, macros) maybe this code snippet can help:
<br />
typedef int (FAR * Func1_Substract)(int, int); <br />
<br />
HMODULE hMod = LoadLibrary(_T("test.dll")); <br />
<br />
Func1_Substract substract = reinterpret_cast<Func1_Substract>(<br />
::GetProcAddress(hMod, "dll_substract_function"));<br />
<br />
int result = substract(10,10); <br />
|
|
|
|
|
This will also need undecorated export functions (ie, created using extern "C" if you're using C++).
It's alway far too easy to break, compared to a header file.
It should work though, but there are a few gotchas.
Iain.
|
|
|
|
|
Can I include Runtime license in to my ActiveX project after building it .
Initially , I did not include it while making the new ActiveX project.
|
|
|
|
|
I need few testing tools - commercial or open source that can help testing an open source application that I am extending.
Need your suggestions and experience?
|
|
|
|
|
Testing...what? Profiling? Performance? Coverage? Leaks? Unit tesing? Regression testing? Load testing? And what platform?
|
|
|
|
|
Thanks Hans, I am especially looking for performance and load testing tools but comments on others are welcome.
like for unit testing - cppunit.
Similarly, if you could suggest me 'try this for leaks and profiling' that would really help. I am actually creating a matrix for all kinds of features that different testing tools and environment can offer.
Thanks in advance for any comments and suggestions.
|
|
|
|
|
Hello
I want to change the background of mainframe window, status bar and menu bar.. without using skins
any help...
Blr Boy
|
|
|
|
|
What are skins ? I mean, I know what they can mean, but how do they differ from what you want to do ?
You can set their background color, or draw a bitmap on them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I tried with some skins.. look and feel is good. but the placement of controls differ for different OS. So i changed my mind to program the same.
If there is any free skin development tools let me know. I can try one more time...
|
|
|
|
|
Change the background to what? Like Christian stated, you can draw a bitmap. Or you can make the
background a different color.
What do you want to do?
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I have a program using C++. This program created a file. I want to delete a particular record in this file. How to do this?
|
|
|
|
|
What sort of file is it ? Probably the answer is, you need to read the entire file, remove the record, and write it back out again.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It's a binary file. I've opened the file using this statement,
fstream ofs("studfile.txt",ios::out|ios::app|ios::in);
I displayed the contents of the file using,
char ch;
int beg,end;
ifstream ifs("studfile.txt",ios::in);
while(ifs)
{
ifs.get(ch);
cout<
|
|
|
|
|
If it's not a txt file, why is it named .txt ?
Either way, why are you reading it one char at a time ?
The answer is unchanged - you need to read the whole thing in, modify it in memory, then overwrite it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Does this file a text file?
|
|
|
|
|
It's a binary file. I've opened the file using this statement,
fstream ofs("studfile.txt",ios::out|ios::app|ios::in);
I displayed the contents of the file using,
char ch;
int beg,end;
ifstream ifs("studfile.txt",ios::in);
while(ifs)
{
ifs.get(ch);
cout<
|
|
|
|
|
Hi
Since you have created the file. The structure of the file can be defined by your self so that the random position of the record can be obtained with lesser seek operation and move the remaining portion of the file.
You can define your own methods appropriately to the organisation of the file structure.
Best Regards
Raj
|
|
|
|
|
Hello,
in a subproject,while compiling a cpp file which includes afximpl.h, I'm getting the following error message:
c:\Programme\Microsoft Visual Studio 8\VC\atlmfc\include\..\\src\\mfc\\afximpl.h(734) : error C2976: 'CArray' : too few template arguments
The error is caused by a class CVariantBoolConverter, also in afximpl.h:
class CVariantBoolConverter <br />
{<br />
protected:<br />
CArray'<'CVariantBoolPair> m_boolArgs;<br />
public:<br />
...
As CArray is forward declared in afx.h as
template'<'class TYPE, class ARG_TYPE><br />
class CArray;
C2976 occurs because of the missing ARG_TYPE argument in the CVariantBoolConverter declaration.
So far so good... but when I dig deeper to the original declaration of CArray in afxtempl.h:
template'<'class TYPE, class ARG_TYPE = const TYPE&><br />
class CArray : public CObject<br />
{<br />
public:<br />
CArray();<br />
...
ARG_TYPE is suddenly optional!
This is clearly a mismatch between the forward and real declaration of CArray, but the question is why am I the only one wich seems to be having problems with this bug?
We already have successfully converted other projects using templates without errors in my company, and I can't find anyone via Google or Usenet who is having the same or a similar problem.
Since I'm completely and now I hope someone can shed a ray of light on this...
adTHANKSvance, Skarrin
|
|
|
|
|
I thought CArray always had two args ? I guess it's too late to convert this code to standard C++, but for future reference, using the standard containers ( such as vector ), would insulate you from these sort of issues.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: I thought CArray always had two args ? I guess it's too late to convert this code to standard C++, but for future reference, using the standard containers ( such as vector ), would insulate you from these sort of issues.
The code snippets I posted are all located in Microsofts very own header files .
The cgraph.cpp file which causes the error does not use any template classes itself, it just includes afximpl.h because it calls other functions like AfxGetFileTitle defined there.
(In case anyone knows it, the subproject making trouble is an old commercial product called "Graphics Server 5" from "Bits Per Second Ltd.", which we last upgraded before 2000 ).
Regards, Skarrin
|
|
|
|
|
It works fine for me, even using the default (omitting the) 2nd template parameter.
Some things to check:
Make sure afxtempl.h is included before trying to define a CArray class.
Make sure the TYPE used in the definition is defined before trying to define a CArray class using
that type.
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|