|
does anyone have some source code of Screensaver written in C++ .net.(managed) .
or know how to do it ?
i have found some in MFC, win32api or C#.., but C++ managed.
tks..
|
|
|
|
|
Just use managed code, and do exactly what the other code does. The system has the same expectations of a screen saver, no matter what the language.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all,
I have an application in C++. Now inorder to provide unicode support for the same, is there any tool which provides details like exactly which part of code has to be replaced with unicode data types?
Thanks and Regards,
Sree
|
|
|
|
|
I'm not sure I totally understand... What is the library you based the code off of? STL, QT, or what? I assume that you want to move to .NET. That's going to be the thing that decides the final answer.
If you are using standard C++ type then you should understand that characters, in most standard libraries, are 8 bits (1 byte, Ascii http://www.lookuptables.com/). Unicode is 16 bits (2 bytes). The conversion should require come simple binary casting stuff. Look up both and find the differences.
BTW, .NET loves Unicode. Look through the MSDN at System::Char and you will see that by default its a Unicode char.
|
|
|
|
|
hi,
i created a windows service application. when i installed the application using installutil.exe i didn't get any error but the application did not start (set the startType to automatic) when i restarted my computer
please advice....
|
|
|
|
|
Hello,
I have an MFC C++ application. I would like to ship the .exe to another person's machine(WinXP). What are the minimum requirements that are needed on the target machine for it to execute. It complained about a missing DLL. I am still not clear about this. Thank you in advance.
Joe
|
|
|
|
|
This has nothing to do with managed C++. What dlls you need depend on your build settings, and what code you used. MFC lives in a dll, and you need to ship that with the app if you didn't statically link. If you used C runtime functions, you may also need MSVCRT, the thing to do is to run an application like depends, that tells you what your app needs, or get a clean machine and keep adding the stuff it asks for until it runs, then ship with that stuff in future.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian,
Thanks for the reply.
Joe
|
|
|
|
|
Well my code is slpitted in: one myClasses.h and one myClasses.cpp files and it's something like this:
// *** myClasses.h: ***
#define SIZE 10
public __gc class MyClass;
public __gc class AnotherMyClass;
public __gc class MyClass{
public:
MyClass();
void myMethod();
private:
bool myArray __nogc[SIZE];
AnotherMyClass* anotherMyClass;
};
public __gc class AnotherMyClass{
public:
AnotherMyClass(bool myArray __nogc[SIZE]){ // constructor is inlined
for(int i=0; i<size; i++)
="" this-="">myArray[i] = myArray[i];
}
private:
bool myArray __nogc[SIZE];
};
//*** myClasses.cpp: ***
MyClass::MyClass(){
for(int i; i<size; i++)="" myarray[i]="true;
" anothermyclass="NULL;
}
void" myclass::mymethod(){
="" anothermyclass(myarray);
}
="" ***="" oh,="" and="" this="" is="" the="" main="" (in="" another="" file):="" ***
int="" _tmain(){
="" myclass*="" myclass="new" myclass();
="" myclass-="">myMethod();
return 0;
}
So far I receive this error, but I can't understand why and how to fix it (without using managed arrays):
error C2664: 'AnotherMyClass::AnotherMyClass' : cannot convert parameter 1 from 'bool [10]' to 'bool []'
I can't find anything on google too, help help!
|
|
|
|
|
Please modify this thread and chose "do not treat <'s as HTML tags"
|
|
|
|
|
I have created a class library that uses managed extensions for c++ [manageddll] where i have a test() unmanged function with a dll export decoration.
I later tried loading this dll from an MFC based dialog application and tried calling the test() function. The app crashes at run time.
If anybody could help me in this regard?? Thanks in advance.
|
|
|
|
|
I would guess that the loader does not recognize that the .NET managed assembly is valid. MFC has no concept of metadata nor the .NET assembly header format.
Just out of cusiosity, why would you want to do this?
|
|
|
|
|
This might be a better explanation than my response:
http://msdn.microsoft.com/msdnmag/issues/05/01/CQA/[^]
Read the final question: "Can I Call the .NET Framework from my MFC application?" (The answer is Yes). The author explains the problems associated with this type of operation.
|
|
|
|
|
I m doing this because i would like to use the same managed c++ dll for both my managed and unmanaged clients.
Check this page for calling managed c++ from an unmanged environment:
http://www.codeproject.com/dotnet/bridge.asp
This sample worked fine if i called from a win32 console application but when loaded from MFC app. It crashed during runtime.
|
|
|
|
|
I read the article and downloaded the code and read that, and I'm embarrassed to admit, that I couldn't understand how exactly it was supposed to work.
I feel terrible. My advice above, obviously was completely incorrect.
|
|
|
|
|
i have here this pice of code from a class
i dont understand what does _RSA_FZM_CLASS stand for.what must i type in as search to get more information on this type of declarations of classes
class _RSA_FZM_CLASS TRsaFuzzyAccumulation : public TRsaFuzzyOR
{
public:
//member functions
};
|
|
|
|
|
It's probably a MACRO, so put your mouse over it and see if intellisense tells you what it really means.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Grauss wrote:
t's probably a MACRO, so put your mouse over it and see if intellisense tells you what it really means.
and if it doesn't, search for _RSA_FZM_CLASS into your hole project, and in the included files...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi,
Does anyone know how to convert a pointer to a managed class to a void * so I can pass it to a unmanaged function which will call into a managed function with the void pointer which then needs to convert the void pointer back to a managed pointer. All the code is in the same exe I am not calling into a dll.
Here is a chunk of code as an example:
__gc class mcFoo {
.
.
.
public: int x;
};
tmain()
{
mcFoo *Foo = new mcFoo();
Foo->x = 1;
xxx(Foo);
//Foo->x == 2
}
#pragma unmanaged
xxx(void *ump)
{
yyy(ump);
}
#pragma managed
yyy(mcFoo *mp)
{
// mp-> x == 1
mp->x = 2;
}
|
|
|
|
|
I believe I have found the solution. By creating a unmanaged class and having it contain a pointer to the managed class (using gcroot) and passing that to the unmanaged function it apears to resolve the compiler issues. If this is the right aproach I have a new question:
If the managed class is complex in that it conatains pointers to other managed classes, such as a container class, do I need to do more such as define the layout mechanism of the class? I am not using this pointer in any of the unmanaged code, just passing it through from on managed function to another through a unmanaged function.
|
|
|
|
|
Hi,
I have a dll that is using mixed mode. I followed these steps to create the
project:
1. Created a managed C++ class library.
2. Added methods and code that uses unmanaged MFC (CString).
3. Compiled.
4. Added this dll as a reference in some C# project.
5. Used the managed classes that were coded in the dll.
Everything was normal until i tried to fix the linker warning:
LINK : warning LNK4243: DLL containing objects compiled with /clr is not linked with /NOENTRY; image may not run correctly
This link says how to fix the linker warning:
http://msdn.microsoft.com/library/d...tomixedmode.asp
Please check the steps given under the section:
"To convert the managed DLL to mixed mode"
After doing whatever was mentioned in that section, when I access a
method in the dll that uses CString, I get an exception in one mfc file.
Details of the exception:
-------------------------------
File : f:\vs70builds\3077\vc\MFCATL\ship\atlmfc\include\cstringt.h
Line : 1088
Expression : AtlIsValidString( psz )
... and blah blah.
Can anyone help me in fixing the linker warning as well as the exception ?
Thanks in advance.
-Raj.
|
|
|
|
|
Hello,
I have created an MFC C++ application. I copy the exe to my colleagues machine.
I want to execute it on my his machine but when I do so on his machine it says hat the MFC71D.DLL
is missing. All I am doing is copying over the exe, I expected it to execute.
Can anyone help? Thank you, Joe
|
|
|
|
|
He has the .NET Framework 1.1 installed... I forgot to mention this.
|
|
|
|
|
joseph1950 wrote:
says hat the MFC71D.DLL
is missing
The D means you gave him a debug build - NEVER do that.
MFC is a dll, as you have discovered. If a release build does not work, then you need to give him the dll. If you've used C runtime functions, you'll need MSVCRT something.dll ( I forget the number ). To avoid this, choose 'use MFC as a static library' when you build your next MFC app, it will be bigger, because it will include the MFC code you use in your app.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you for your replies. I pulled down project -> properties->general and changed the debug to release and then rebuilt the application. I then also experimented with changing shred dll to static dll as well. My coworker hasn't yet tried the new versions. Am I doing what you said to do?
Joe
|
|
|
|