|
Hi!
But which restrictions? I do have w/r rights for that drv.
In addition, my .exe has already successfully called 1 other dll (which is native c++ (fortunately ) before calling the c++ managed dll.
Meanwhile, I used the MS Dependeny walker. The profile results
seem to show that there is a problem even when the program
is started from a local drive ( by the way: which u don't notice
without any tool, because it runs correctly )
Profile: ( static link this time )
caloader.exe = my exe
cabridge = my c++ managed.dll
Started "CALOADER.EXE" (process 0x6E8) at address 0x00400000.
Loaded "NTDLL.DLL" at address 0x77F40000.
.
.
.
Loaded "CABRIDGE.DLL" at address 0x10000000.
Loaded "MSCOREE.DLL" at address 0x79170000.
DllMain(0x78000000, DLL_PROCESS_ATTACH, 0x00000000) in "RPCRT4.DLL" called.
DllMain(0x78000000, DLL_PROCESS_ATTACH, 0x00000000)
.
.
.
Entrypoint reached. All implicit modules have been loaded.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x0012FD30) in "CABRIDGE.DLL" called.
Loaded "MSCORWKS.DLL" at address 0x791B0000.
Loaded "MSVCR70.DLL" at address 0x7C000000.
Loaded "FUSION.DLL" at address 0x79040000.
.
.
.
Loaded "MSCORLIB.DLL" at address 0x79780000.
Loaded "MSCORLIB.DLL" at address 0x79960000.
DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x0012FD30) in "CABRIDGE.DLL" returned 1 (0x1).
DllMain(0x77E40000, DLL_THREAD_ATTACH, 0x00000000) in "KERNEL32.DLL" called.
DllMain(0x77E40000, DLL_THREAD_ATTACH, 0x00000000) in "KERNEL32.DLL" returned 1 (0x1).
DllMain(0x77DA0000, DLL_THREAD_ATTACH, 0x00000000) in "ADVAPI32.DLL" called.
DllMain(0x77DA0000, DLL_THREAD_ATTACH, 0x00000000) in "ADVAPI32.DLL" returned 14679041 (0xDFFC01).
DllMain(0x78000000, DLL_THREAD_ATTACH, 0x00000000) in "RPCRT4.DLL" called.
.
.
First chance exception 0x80000003 (Breakpoint) occurred in "MSCOREE.DLL" at address 0x79172064.
First chance exception 0xC0000005 (Access Violation) occurred in "CABRIDGE.DLL" at address 0x10000005.
Second chance exception 0xC0000005 (Access Violation) occurred in "CABRIDGE.DLL" at address 0x10000005.
Exited "CALOADER.EXE" (process 0x6E8) with code 128 (0x80).
If you did read until here, thanks
here's my dll:
#include "stdafx.h"
#include "cabridge.h"
#include "windows.h"
extern "C"
{
#include <string.h>
}
#using "mycsharp.dll"
using namespace System;
using namespace mycsharp;
BOOL WINAPI DllMain (HMODULE hModule, DWORD x, LPVOID <)
{
return TRUE;
}
extern "C"
{
__declspec (dllexport) void __cdecl CallCobolAssistBridge(char *pszFileName, int icode, int hwndoutput)
{
String __gc *managed_input = new String(pszFileName);
mycsharp __gc *Mycsharp;
Mycsharp = new mycsharp;
Mycsharp ->DOStuff(managed_input,icode, hwndoutput);
return;
}
}
i hope this wasnt to much..
tanks,
byebye
|
|
|
|
|
sorry, please ignore
extern "C"
{
#include
}
was a copy / paste err
thanks for your help!
|
|
|
|
|
Hi, consider this thread as "solved" .
Meanwhile, someone has given me a hint :
The problems i seem to have are described
in the MSDN tecnical articles, topic "Mixed DLL Loading Problem".
It further seems to be some kind of runtime-problem and can be avoided somehow.. perhaps..
I'll try it out
|
|
|
|
|
good day,
just started with c++ coding...bfore i start on...wud require some help starting of with pacman....wud appreciate if i get help on the uml class diagram n the oop code...i'm starting on the turbo package..but wud go on with linux...appreciate yur help,
ozz
|
|
|
|
|
Ummm.... What?
PacMan? Turbo package? Linux?
Specifically, what are looking for help on?
...because your post made no sense whatsoever...
RageInTheMachine9532
|
|
|
|
|
sorry mate if i wznt clear.....simply need the oop code in c++ for pacman...thtz all
|
|
|
|
|
Well, I don't know about a C++ version, but this[^] is the Java version. Java is close cousin to C++, so it should do the job for you.
RageInTheMachine9532
|
|
|
|
|
When I compile my .exe the compiler give me this error:
"error LNK2020: unresolved token (0A0000FD) SysStringByteLen"
"error LNK2020: unresolved token (0A000101) SysAllocStringByteLen"
This problem occur when I set the proprety project "Treat wchar_t as Built-in Type" (in th C/C++\Language Menu) to "No". My project use Managed Extensions and C# class.
I try (how is described in MSDN) to include "oleauto.h" and to link oleaut32.lib, but it was all in vain.
Thank you very much for any answer.
|
|
|
|
|
Hi !
I am ran into a great problem I can not solve. I need to write a Dial-Up Server project in Win98 by visual c++.
I do followed steps:
1) With TAPI wrote a program that can wait fo call.
2) After client Dial-in (by Dial-up networking),my program answer and connect to client. But problem is here that I can't write the code that build the RADIUS packet for reply to packet that is sent from client.
If could help, please let me know.
A BIG thanks in advance.
|
|
|
|
|
How can I convert managed string (System::String) to unmanaged array of chars? (char *)
--------
Dave
|
|
|
|
|
<font color=green>
#include <vcclr.h>
String* s = S"Hello";
const __wchar_t __pin * str = PtrToStringChars(s);
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - Jörgen Sigvardsson
|
|
|
|
|
Hi,
I have a Object derived class (managed) which is called 'MyObject', and I want to perform the UNmanaged method 'PostThreadMessage(UINT threadMessage, WPARAM, LPARAM)' using a 'MyObject' object as WPARAM. like this:
MyObject *pObject = new MyObject;
myThread -> PostThreadMessage(WM_MYMSG, (WPARAM)pObject, NULL);
How can I convert it?
And how to convert back ?
Thanks in advance.
|
|
|
|
|
You'll need to pass gcroot<MyObject>* instead.
|
|
|
|
|
I am trying to wrap an extensive C++ library in managed code , but I am falling over at the first hurdle. I build a simple console app as below and the first time I run it it works. I then clean the project, close it , reopen it and rebuild it and I get "void __cdecl operator delete(void*) (??@YAXPAX@Z) already defined in LIBCMTD.lib (dbgdel.obj)" . I think I have to specify a managed or unmanaged new/delete for the managed or unmanaged objects , but I cannot see how. Anyone help ?
<br />
#include "stdafx.h"<br />
#include "afxwin.h"
#include "afxext.h"
#using "mscorlib.dll"<br />
<br />
using namespace System;<br />
<br />
#pragma unmanaged<br />
class UnManaged<br />
{<br />
public:<br />
<br />
UnManaged()<br />
{<br />
}<br />
~UnManaged()<br />
{<br />
}<br />
void Show()<br />
{<br />
AfxMessageBox("Hello From the UnManaged world");<br />
}<br />
<br />
};<br />
#pragma managed<br />
public __gc class MyManaged<br />
{<br />
public:<br />
MyManaged()<br />
{<br />
m_ptr = new UnManaged;<br />
}<br />
~MyManaged()<br />
{<br />
delete m_ptr;<br />
}<br />
void Show()<br />
{<br />
m_ptr->Show();<br />
}<br />
private:<br />
UnManaged *m_ptr;<br />
};<br />
int _tmain()<br />
{<br />
Console::WriteLine("Hello Managed World");<br />
MyManaged *mg = new MyManaged;<br />
mg->Show();<br />
return 0;<br />
}<br />
<br />
>
|
|
|
|
|
Everytime I have a few SqlDataAdapters + DataSets on my form, the designer takes
over 10+ minutes to just open up the form!
What the heck is wrong with it and how do I fix this? Anyone else have this problem?
Thanks
|
|
|
|
|
Hi,
I have a simple doubt.
I've created a struct TEST like this:
_value struct TEST
{
String *str;
int cont;
};
When I try to dynamically allocate TEST like this:
TEST *pTest = new TEST;
A compilation error says to me that 'a value type object cannot be dynamically allocated with managed members on C++ (nogc) heap'
I must use the 'str' variable within this structure, so how can I dynamically allocate TEST ?
Thanks in advance.
|
|
|
|
|
As covered in Chapter 1 of my "Extending MFC Applications with the .NET Framework", this can never work because __value types are allocated dynamically in the C++ heap (free store) whereas __gc types are allocated on the CLR heap. In your example, the TEST struct is a __value type but contains a __gc embedded type. If you need TEST::str to be of type String*, then you need to make the TEST struct a __gc struct. That will compile without errors.
Cheers,
Tom Archer
* Inside C# -Second Edition
* Visual C++.NET Bible
* Extending MFC Applications with the .NET Framework
|
|
|
|
|
Sorry if i've choose not suitable thread. I can't understand exactly wich forum I need.
How can I set position of printf (or cout) output? If I've already print a half screen of a text and I want return to some used position (e.g. 10th symbol) and start to overwrite existing text what should I do? No one knows how to do this under win32 please, help.
|
|
|
|
|
If you knew you were on the same line you could output some '\b's to backspace to the appropriate place, but it doesn't around like that's the case for you. As such you need to use the Win32 Console APIs, in particular SetConsoleCursorPosition(), but they don't intergrate particularly well with standard IO.
Depending on your specific needs, you might get away with just ensuring you've flushed your output before changing the cursor position. If not, you may need to switch to using the Console API for all your output.
-Blake
|
|
|
|
|
Hi there !
I need to use a web service written in VB.NET .
i want to write a C++ client to use the service. how can
we do it in C++.
Abhi....
|
|
|
|
|
Abhi Avasthi wrote:
how can
we do it
By asking the right people. Try the Visual C++ forum.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Dear friend,
I want to develope a telnet Client using C++ .net but
i am biggener in C++ .net so i dont know whether any telnet
API,function or calsses in C++ .net which will help to develope telnet Client.if u know then let me know thanx in advance.
Ar if
|
|
|
|
|
Hi,
I have a managed c++ project which I've included a CWinThread derived class (CMyThread). It works fine until I call 'pMyThread -> PostThreadMessage(...)'. It occurs a exception...
Is it possible to use 'PostThreadMessage' in a managed C++ project ?
I know that it's a little weird, but I really will appreciate if someone help me.
Thanks in advance.
|
|
|
|
|
Does your thread has a message pump?
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I believe it does...
I fact, I took this thread class (CMyThread) from a working UNmanaged c++ project, erased all the methods and kept only one... for test purposes. I've done no extra code.
So, from the class 'MyClient' (which is a managed c++ class) I call:
pMyThread -> PostThreadMessage(SWM_TEST, NULL, NULL);
I really don't know if Managed C++ works in the same way of Unmanaged C++ when it comes to processing messages.
Please, help me.
thanks.
|
|
|
|