|
Doesn't look like C++/CLI to me....
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 seems that your code isnt C++/CLI maybe better you ask on the Visual C++.;)
|
|
|
|
|
Hi!
My problem is how to properly create and load a static library of CxImage.
I work with Borland C++ Builder 6.
I think I don't fully understand instruction connected with files I've downloaded from www.xdp.it .
This is the first time I'm working with DLL libraries so I'm very confused
I would be very grateful for any assistance
Bieras
|
|
|
|
|
This doesn't look like a managed C++ question so you should post it on the Visual C++/MFC board.
I took a look at the site - It appears to be a c++ library so the author probably includes
header file(s) to use in your source code and lib file(s) to link with your project.
The author also appears to be a CPian, so if you go to the article(s) that he wrote about the
library, you can leave a message for him directly. See here[^] for an example.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
Thank you for answer Mark ,
but that was not exactly what I asked about. I have already read this article, but I don't understand if I have to Built given .cpp files one by one and then add them to my project or make one library file? And one more. Should I built all the files in the library or only that which contains information of the kind of
// To add a file to the library use the Project menu 'Add to Project'
and with header
#define Library
at the end ?
Bieras
PS. Sorry for my poor English, and for my questions but I'm just the beginner in that kind of programming.
|
|
|
|
|
There's a section in the article I linked to that explains it better than I ever could (I didn't write the library ) - "Using CxImage in your projects".
It looks like you need to build the libraries (with the supplied workspace/projects) and then
link to the resulting libraries.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
Is it possible to define static classes as in C#? If not, is the following sufficient:
public ref class MyStaticClass
{
public:
private:
MyStaticClass() {};
~MyStaticClass() {};
MyStaticClass( const MyStaticClass% ) {};
}; If I enable code analysis, I get warnings on the copy constructor and the destructor:
warning: CA1811 : Microsoft.Performance : 'MyStaticClass.MyStaticClass(MyStaticClass)' appears to have no upstream public or protected callers.
warning: CA1801 : Microsoft.Usage : Parameter '' of MyStaticClass.MyStaticClass(MyStaticClass) is never used. Remove the parameter or use it in the method body.
warning: CA1822 : Microsoft.Performance : The 'this' parameter (or 'Me' in VB) of MyStaticClass.~MyStaticClass():Void is never used. Mark the member as static (or Shared in VB) or use 'this'/'Me' in the method body or at least one property accessor, if appropriate.
|
|
|
|
|
You can't declare the class static but yes, static methods and member variables will give the
same behavior.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter N
|
|
|
|
|
I also want to ensure that MyStaticClass cannot be instantiated. Do you think I should make the class sealed in addition to what I've listed above? And do I need to worry about operator=() ?
|
|
|
|
|
sealed is good to ensure no derived classes.
Off the top of my head, I'd say just having a private default constructor is sufficient.
Without being able to instantiate any objects of the class, the destructor, assignment operator,
and copy constructor are irrelevant.
If, after some more caffeine, I change my mind about that, I'll let you know
Mark
This episode brought to you by the letter N
|
|
|
|
|
OK. Thanks for the input. This is what I'm going with:
public ref class MyStaticClass sealed
{
public:
private:
MyStaticClass() {};
};
|
|
|
|
|
That looks like a static class to me
Cheers,
Mark
This episode brought to you by the letter N
|
|
|
|
|
Hi
I am trying to make a detour wrapper class and so i have created some template functions and classes. These are the classes(in simplified form):
Header File:
<br />
#ifndef DETOUREME_H<br />
#define DETOUREME_H<br />
<br />
#include "..\..\..\stdafx.h"<br />
<br />
HRESULT WINAPI somefunction( void );<br />
<br />
class DetourWrapper<br />
{<br />
public:<br />
DetourWrapper(void){};<br />
~DetourWrapper(void){};<br />
<br />
template<typename H> BOOL isDetoured ( H* pClass, int iType );<br />
};<br />
<br />
class DetourThis<br />
{<br />
public:<br />
DetourThis(){};<br />
~DetourThis(){};<br />
<br />
virtual BOOL isDetoured( void ){ return TRUE; };<br />
};<br />
<br />
extern DetourWrapper g_pDW;<br />
extern DetourThis *d_pDT;<br />
<br />
#endif
CPP File:
<br />
#include "Debug.h"<br />
<br />
extern DetourWrapper g_pDW;<br />
extern DetourThis *d_pDT = NULL;<br />
<br />
template<typename H> BOOL DetourWrapper::isDetoured ( H* pClass, int iType )<br />
{<br />
return pClass->isDetoured();<br />
}<br />
<br />
HRESULT WINAPI somefunction( void )<br />
{<br />
d_pDT = new DetourThis;<br />
BOOL enabled = g_pDW.isDetoured(d_pDT, 2);<br />
}
Error:
Linking...<br />
Debug.obj : error LNK2001: unresolved external symbol "class DetourWrapper g_pDW" (?g_pDW@@3VDetourWrapper@@A)<br />
C:\Documents and Settings\Steal.Patrick\My Documents\Visual Studio 2005\Projects\Detours\Release\Detour.dll : fatal error LNK1120: 1 unresolved externals
Can someone please tell me what i am doing wrong here?
Thanks
|
|
|
|
|
I have linked my C/C++ static libraries compiled in VS2005 to my C++/CLI interop project, I want to use C++/CLI interop to export this functionality to C# client.
If i put a call to any static lib function in this interop project, The Interop project compiles properly but gives runtime error
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: ...
File: dbgheap.c
Line: 1473
Expression: _CrtIsValidHeapPointer(pUserData)
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
---------------------------
Do I need to initialize CRT or somthing in the interop project
If i use a test static lib (static lib created for testing purpose by me) everything works fine, problem occurs when I link my products static libraries and try to call a function from these static lib in my interop project
Subodh Borker
|
|
|
|
|
Hello Subodh,
One clean solution would be to wrap your static library into the regular DLL, which can then be used within the CLI project.
|
|
|
|
|
I am using Visual c++. Net 2005 with sql server 2000 database.
If I change or add new fields in tables; who can I refresh my Dataset object
|
|
|
|
|
By doing a request for data from the DB, 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 )
|
|
|
|
|
Bonjour,
i introduce a laibrairie in my project, whene i compile there are error :
D:\Program Files\Microsoft Visual Studio 8VC\PlatformSDK\include\wspiapi.h : (44)error C2894: templates cannot be declared to have 'C' linkage
please help me to resolve this pb.
Thank you verry mutch
|
|
|
|
|
Doesn't look like a CLI question to me, have you tried the visual C++ forum ?
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 )
|
|
|
|
|
In my form a have one datagridView to show all data from my table. And I have textboxes from where I changed data on my table when I click on a button "save".
Now I want those changes can be shown immediately on my datagridView without leaving the form and return.
What can I do so to refresh datagridview datasource programmaticcaly .
|
|
|
|
|
I think there is a Refresh method you can call.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Refresh don't working
The solution is to bind again datasource
|
|
|
|
|
Hi
is it possible to declare a vector with a name that we read from a file or cin?
thanks
|
|
|
|
|
I think you're in the wrong forum, you're asking about standard C++ stuff, not .NET. Either way, the answer is no. You can't make a variable name dynamic, and why on earth would you ? You can create a map of strings to vectors, and name them that way.
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 )
|
|
|
|
|
yes i think i m in the wrong place...
What do you mean with you can create a map of strings to vectors, and name them that way.
thanks
|
|
|
|