microsoft.public.dotnet.languages.vc Archive - March 2002
Post a message to this list
Messages
Page: 1
Templates and Friends (4 replies)
microsoft.public.dotnet.languages.vc
Hi there I could use a hand in figuring out how to overcome a little problem I'm having regarding private members in a template and "friend" classes. If you look at the following code: class SomeClass; namespace SomeNamespace { template typename Tag class SomeTemplate { friend class ::SomeClass; private: unsigned int SomeInt; }; } class SomeClass { void SetHandle (SomeNamespace::SomeTemplate *pTem...
How to declare a field of a managed type in an unmanaged class? (2 replies)
microsoft.public.dotnet.languages.vc
Hi, Is it possible to declare a member variable of a class with a managed type in an unmanaged class? What's the trick? class ATL NO VTABLE COOPObject : public CComObjectRootEx CComSingleThreadModel , public CComCoClass COOPObject, &CLSID OOPObject , public IDispatchImpl IOOPObject, &IID IOOPObject, &LIBID EVATLOOPServerLib, /*wMajor */ 1, /*wMinor */ 0 { public: COOPObject() { m counter 0; this C...
Need help serializing object in managed c++ (2 replies)
microsoft.public.dotnet.languages.vc
Hi, I'm trying to send an object across a network and I'm trying to implement serialization but I'm not doing it right. I tried searching for tutorials and articles but they're for C#. [Serializable] gc class FileTransferHeader { public: FileTransferHeader(String* theFileName, Int64 theFileSize); property Int64 get Size(){return fileSize;} property String* get Name(); private: Char fileName nogc[2...
Isin, IsOut, Isretval dont work ? (2 replies)
microsoft.public.dotnet.languages.vc
This is a repost with some sourcecode. I have some code in MC that I access via reflection in C#. I examine the available methods in my C# code and can read the parameter name and types but all of isin, isout and isretval properties are always false. Any suggestions? // TestSink.cpp #include "TestSink.h" // TestSink.h #pragma once #using mscorlib.dll using namespace System; namespace PaR { public ...
Using VC++ to read event log. (2 replies)
microsoft.public.dotnet.languages.vc
I am trying to retrieve event log information using VC .net. I am able to retrieve eventlog informaion form the EVENTLOGRECORD structure like EventID etc.. but I am unable to retrieve the event Description (event Message). How do I access the date from the event Description (event Message) field? Thanks for your help Heinz
How to call Win32 API? (13 replies)
microsoft.public.dotnet.languages.vc
Hello, im playing with the RC1, and trying to call the ShellExecute Win32 API function. I am still working on learning C , and i remember that in the old (pre dotnet), you had to have the #include statement, and the LIB file had to also be included in the linker options. Well, i have both of these conditions met now in my C .NET project, and i still get the error: "ShellExecute Undeclared Identifi...
Runtime error in Release but not Debug (2 replies)
microsoft.public.dotnet.languages.vc
This is a problem I get in both VC6.0 and VC.NET. I have an application that runs fine durring debug. No errors. But when I run it in Release mode it throws an exception when I try to acces a simple boolean value. I've tried to recreate the error using a simpler process but I can't. It seems to be specific to the class that I'm using and where I'm using it. Any ideas?
VB/VC COM (6 replies)
microsoft.public.dotnet.languages.vc
I'm trying to pass a char * to a VB COM dll via VC. The VB dll is converting the strings to BSTR pointers (they are byRef variables). I posted char* to BSTR* earlier and got a response (thanks Alexander), however that requires modifying the .tlb produced by VB which I don't know if that is possible. Does anyone know if that is possible? Are there ways of manipulating the functions within vb to mak...
how do I get the module handle in an MFC DLL? (3 replies)
microsoft.public.dotnet.languages.vc
Please.... anyone... how do I get the module handle inside an MFC DLL. I see NO reference to the HMODULE passed to DllMain.. What I'm really trying to do is get the path of the DLL. HOW THE *(#$* DO I DO IT!?????
In c# u can use using keyword to invoke dispose(), can you do the same in c++ (3 replies)
microsoft.public.dotnet.languages.vc
just curious because it won't throw exceptions when you use the using keyword in c#. Can the same be done in c ? would be great for closing sockets, streams, and files.
Really Easy Help needed Managed c++ syntax for declaring array of unsigned long (2 replies)
microsoft.public.dotnet.languages.vc
I am not a c person so please forgive this really basic question. I need to declare an unsigned long array with 256 positions in c# you would do something like Byte[] buffer new Byte[256]; for a Byte array I am trying to declare this in the header file of a managed class with the syntax of "static unsigned long gc variablename[256];" I get an error error C3150: 'variablename' : ' gc' can only be a...
mixing .net framework functions and win 32 sdk (2 replies)
microsoft.public.dotnet.languages.vc
Has any one has any problems with calling functions when mixing together MFC and .net managed extensions for c/c ? If I use function and use header include "afx.h" System::IO::Directory::GetCurrentDirectory? I get error message: c:\Besedila\Visual Studio Projects\C\Razno\Get Current Directory\Get Current Directory.cpp(19): error C2039: 'GetCurrentDirectoryW' : is not a member of 'System::IO::Direc...
C1001on specifying StructLayout (3 replies)
microsoft.public.dotnet.languages.vc
Hi guys, I am trying to import the serial port DCB (defined in winbase.h i think) into the managed world. The StructLayout attribute chokes the compiler. I need the attribute, otherwise SetCommState( handle, dcb ) throws a runtime exception, saying that it needs the layout of dcb to be able to marshal the struct correctly. What do I do? Sameer. [StructLayout(LayoutKind::Sequential)] private gc str...
Bug in compiler? Function being called is the wrong one :-( (5 replies)
microsoft.public.dotnet.languages.vc
I have an unmanaged C module with a managed section to it allowing me to use it's funcionality in c#. One of the functions I call internally in the C module has a variable number of parameters, but when I call it a totally different function gets called. This wrong function that gets called instead is called by the correct function as part of it execution and if I comment it out within the correct...
WM_NCHITTEST in C# (2 replies)
microsoft.public.dotnet.languages.vc
I am converting a small MFC application to C# just to learn the language. The application uses the WM NCHITTEST for various reasons, and I can't seem to find an (easy) way to handle this message in C#. Any pointers? I am looking for some equivalent to the MFC handler, which looked sort of like this: UINT CNoteWindow::OnNcHitTest(CPoint point) { ... } On a somewhat related note, I am having some is...
Is VC7 unmanaged code really 50 times slower than VC6? (7 replies)
microsoft.public.dotnet.languages.vc
I have been using VC7 (full release version) since it was released, give or take a day or two. My immediate reaction was that the CLR concept is a brilliant idea, but my code (unmanaged C ) felt a bit slow. Amongst other things, I'm involved in a project that is implementing a wide variety of parsers for various proprietary and not so proprietary file formats, which has resulted in a number of rec...
creating strong named assemblies conveniently (or, how to use my own CSP) (2 replies)
microsoft.public.dotnet.languages.vc
I am looking for a convenient way to create assemblies with strong names using VS.NET without having to use a public/private key file. I used the SN.exe utility to generate a public/private key pair for myself so that I could give my assemblies strong names. However, the VS.NET projects that create my assemblies are usually created at the same folder level in my filesystem. This means that I have ...
'System.TypeLoadException' Error (3 replies)
microsoft.public.dotnet.languages.vc
Hi, I am trying to call a C based MATLAB dll which is generated using the Matlab compiler. from a Managed .Net C library. When I try to call one of these functions from a managed C library, I can debug into it if no calls to any of the Matlab based functions is made but if I add a call to a Matlab function then I get the error. 'An unhandled exception of type 'System.TypeLoadException' occurred in...
How to create a C++ class and use it in C#? (3 replies)
microsoft.public.dotnet.languages.vc
Hi, I am using vstudio.NET beta 2. I am writing a C application which does extensive use of C STL containers, namely vector, list, multimap and string. I want to give it a graphic interface, using the new Windows Forms (not MFC). I saw that the Windows Forms editor in not available for C projects, and I don't want to write windows code by hand. Then, at first I tried wanted to rewrite everything i...
type problems with .net types *arrgh* (2 replies)
microsoft.public.dotnet.languages.vc
ok, in .NET you have a byte array and in c# you create it like so; Byte[] mybyte .... Now I have a c# dll that I'm using from mc and one function returns this Byte[] type but I can't seem to create an equivilent in mc ? I tried CByteArray but get a convertion error. I will of course want to then pass the c eq. type back to this function later as Byte[] ? Craig
why does this if statement fail ? (4 replies)
microsoft.public.dotnet.languages.vc
String *sRP ""; // managed .net string sRP Console::ReadLine(); if (sRP "y" || sRP "Y") { } Always skips as if y/Y was not pressed. thanks, Craig
ATL Server ISAPI Extension (2 replies)
microsoft.public.dotnet.languages.vc
Hi, I need to create an ISAPI but don't want to use an SRF. I already have a dll that implements a web service but I have a method that I don't want to expose via soap, but I'd like to be accessible from a URL. How do I mark a method in my handler class as accessible via a URL? Is there a tag for this or do I need to do it some other way.? Mark
How do I mark managed classes as Unicode? (4 replies)
microsoft.public.dotnet.languages.vc
When I look at my assembly with ILDASM, all of my classes are marked as "ansi": MyClass .class public auto ansi How can I mark them as Unicode? Sean
How do I include OpenGL in MC++ program (5 replies)
microsoft.public.dotnet.languages.vc
How do I include OpenGL in a C program which uses purely Managed Extensions.? (the 3d frame is mixed in with other screen objects using windows forms). I have tried doing this by taking the ATL ActiveX Cube sample that comes with VC . I ran the aximp tool to generate a wrapper class that lets me use it as a control in the application. My program compiles and links correctly, but when I run it (in ...
Ad
Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification