|
anyone who doesn't want to provide help please don't disturb
|
|
|
|
|
you suck...
my last answer[^] is still applying...
and there's no need neither to cross post the forums to how an answer... you won't have any until the question is not satisfying...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
If you don't want to code this on your own, you could pay someone to do it, perhaps a classmate who's in need of money.
|
|
|
|
|
#ifndef M1
#define M1
// This is a copy of m1.h
// "EXPORTING STATIC AND NON-MEMBER FUNCTIONS"
// I have three questions that have me foxed. I am very new to c++.net but not c++.
// All code compiled CLR/pure 2005 beta
// A) Need to export Plain c++ functions (not "C" as need function overloading.)
// from a dll so they can be used in the managed exe and other managed dll's
// ( Class's are easy just make them public, but what to do about non
// member functions as you can't use public keyword.
// B) Would also like to export static memeber functions.
// C) On a similar vain I want to export static data
/* would like this to know how this can be made to work
both with and without setting the line below ie for
both gc and nongc class's
*/
//#define TRY_THIS_ALSO
namespace BL {
static void junk2();
#ifndef TRY_THIS_ALSO
public ref class foo {
#else
public class foo {
#endif
public:
int cnt;
};
#ifndef TRY_THIS_ALSO
public ref class bunmanaged {
#else
public class bunmanaged {
#endif
int i;
public:
static foo myStatic ;
bunmanaged(){}
static void junk();
};
};
#endif
//CLI standard
//http://download.microsoft.com/download/9/9/c/99c65bcd-ac66-482e-8dc1-0e14cd1670cd/C++-CLI%20Standard.pdf
//Seems to suggest I might be doomed as can't use public
/* this is a copy of matching m1.cpp
#include "stdafx.h"
#include "m1.h"
namespace BL {
void junk2() {
}
#ifdef TRY_THIS_ALSO
foo bunmanaged::myStatic ;
#endif
void bunmanaged::junk() {
}
};
*/
/* In my other managed class in other dll/exe I have
#using "../Debug/my3Lib.dll"
using namespace BL; //This seems to work so far as the fact that intelisense likes it
I tried many variations on the following.
#using "../Debug/my3Lib.dll"
[DllImport("../Debug/my3Lib.dll",EntryPoint = "BL::bunmanaged::junk()")]
void bunmanaged::junk();
...
public ref class myLibControl : public System::Windows::Forms::UserControl
{
public:
myLibControl(void) {
InitializeComponent();
BL::bunmanaged::myStatic.cnt = 3;
BL::junk();
BL::junk2();
*/
Thanks barry
|
|
|
|
|
The microsoft web site says.
Compiler Warning (level 1) C4272
Error Message
'function' : is marked __declspec(dllimport); must specify native calling convention when importing a function.
It is an error to export a function marked with the __clrcall calling convention, and the compiler issues this warning if you attempt to import a function marked __clrcall.
The following sample generates C4272:
Copy Code// C4272.cpp
// compile with: /c /W1 /clr
__declspec(dllimport) void __clrcall Test(); // C4272
__declspec(dllimport) void Test2(); // OK
|
|
|
|
|
Hi All
i wrote one ISAPI Extension.i have to test it for all possible requestlike chunked, with content-length and non-content length.
presently i want to test it for chunked request. is there any tool or techniques by which i can send chunked request. i think it's very difficult to generate a chunk request.
i anyone know how i can do that or have some code snippet then let me know.
Thanks in advance
|
|
|
|
|
How can I convet string to a desired integer??? Using C++
for example:
January=1
February=2
March=3
......
Hope you can help me
|
|
|
|
|
|
You also canuse :
Int32 January = Convert::ToInt32("1");
|
|
|
|
|
<font color=blue>enum</font> months {
January = 1,
February = 2,
March = 3,
<font color=green>
December = 12
};
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
Hello everyone!
OK, I'm not a bad person, I'm just curious about it, I won't do anything bad, but... How do you do all that memory-screwing, MBR-deleting, screen-locking, CPU-slowing, fill-memory-one-byte-at-a-time-in-one-line stuff in C++? Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
That's pretty funny.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
I'm getting a System.TypeLoadException when I try to access an unmanaged opaque struct.
I have an older, unmanaged API - in 'C' actually - and I am trying to access it from managed C++. The header for the api provides me with an opaque pointer to a struct:
typedef struct _table *TablePtr
so I make a call like this: TablePtr CreateTable();
The internals of the struct are hidden in a private header file.
I have this wrapped in managed C++ - so that my class makes this call in it's constructor:
#include "table_pub.h" // has the typedef for opaque TablePtr
private:
TablePtr mytable;
public:
TableClass(void)
{
mytable = CreateTable();
}
When I call this constructor, I get an exception:
An unhandled exception of type 'System.TypeLoadException' occurred in tester.exe
Additional information: Could not load type _table from assembly olf_mydll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
YET, if I include the PRIVATE header for TablePtr - containing the internal structure definition, it works and I don't get the exception. I don't really want to access the private header - can't guarantee that I'll even have that access going forward.
Is there something I can do to say that this unmanaged type is NOT to be loaded?
Thanks
Rich
|
|
|
|
|
In case anyone else is hitting this problem with forward references, I found a solution on another site - all the compiler wants is a definition for the struct - since we don't want to dereference it, all we need to provide is something like this:
#include "table_pub.h" // has the forward reference - typedef struce _table TablePtr;
// now define the struct in the simplest way:
struct _table {};
Rich
|
|
|
|
|
How to gradually add text to multiline EditBox and scrolling its contents to the last line without blinking of the box. (I've done it MFC app but dont know yet how to work with managed control). For a piece of code big thanks.
9ine
|
|
|
|
|
Is it possible to reengineer a C++ code and Visual basic binary in Windows NT?
Anybody familiar with a tool? Please revert back
|
|
|
|
|
Google for "Win32 Disassembler".
|
|
|
|
|
I don't know where this error message is coming from. It keeps saying that classes and methods aren't where they're supposed to be. Two examples of code that are causing the erros:
this->Icon = (__try_cast<System::Drawing::Icon * >(resources->GetObject(S"icon32.co")));<br />
<br />
MessageBox::Show(S"Error loading Wompi.", S"Loading Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
The first example throws the error C2039: 'GetObjectA': is not a member of 'System::Resources::ResourceManager'
The second throws another C2039: 'MessageBoxA': is not a member etc...
Where is that 'A' coming from? Any help would be greatly appreciated. Thank you.
Sleep is for the WEAK!
|
|
|
|
|
A lot of functions that take strings have two functions, one that ends in A and one that ends in W ( for ASCII and Wide ). Then you have a macro defined for MessageBox, which defines itself according to the type of project, so that it uses the default type of string in use. This macro is what's causing you trouble. I've had the same hassle recently, I tried to write a class method of 'DrawString'. I changed it to 'WriteString' in the end. Writing code to kill the macro may be a solution when it happens with framework methods.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Wow, is that ever a pain in the ass. I don't really know enough about macros to kill it in this case. Where is it getting the default type of string? From the variable I'm passing maybe? Is there maybe something else I've loaded or option I've broken? I've been having problems with strings in general all of a sudden in this program.
Sleep is for the WEAK!
|
|
|
|
|
Ok, I fixed it by using #undef's on GetObject and MessageBox. But now GetObject won't grab the icon file I need it to grab.
this->Icon = (__try_cast<System::Drawing::Icon * >(resources->GetObject(S"app.ico")));
I tried grabbing it by file using System::Drawing::Image::FromFile and then casting it into an icon, but that didn't work either. Does anyone know a way to grab the .ico from the file? I'll just keep it in the same folder as the .exe. Thanks in advance.
Sleep is for the WEAK!
|
|
|
|
|
If you hover your mouse over GetObject befure you UNDEF it, you can right click and go to the macro definition. Copy that and write your own, but rename it. Then you can use that.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Do something like this :-
#pragma push_macro("MessageBox")
#undef MessageBox
MessageBox::Show(...);
#pragma pop_macro("MessageBox")
Nish
|
|
|
|
|
How can i make a variable volatile in c or c++ without actually qualifying it using the keyword volatile..
:->
|
|
|
|