Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Fri, 1 Aug 2008 02:07:23 -0700 (PDT),    group: microsoft.public.dotnet.framework        back       


Newbie question: How to use C++ in .Net Framework   
Hi, all:
        I'm new to .Net, so don't laugh at my questions if they sound
silly.
        Here it comes, I want to utilize classes in .Net framework
namespace, such as system.collections. Things become simple if I'm
coding in C#( just using ... ), however, I'm modifying a C++ program,
and, it's MFC supported. I think what I should do is to import
corresponding libs to introduce classes and namespaces in .Net
framework. Am I right?
        That's the first question. The second is, importing libs seems
tricky, there're few examples I could follow, is it better for me to
build a COM/DLL with C# so that I could just call it in C++?
        It would be more convenient if some background is supplied. My
object is to use a serializable hash class to store a large amount of
URLs. It must be serializable, so that at the first time, I could
build hash with URLs as keys, then dump the hash into a file. From
then on, when I get a new URL, first I should load the hash from the
file, next, I could check it among the URLs for existance, rebuild
hash could be avoided.
        As to my situation, which hash class is suitable? I've got
system.collections.hashtable, and some
System.Security.Policy.hash, ... Thanks a lot for you help.
date: Fri, 1 Aug 2008 02:07:23 -0700 (PDT)   author:   Fred

RE: Newbie question: How to use C++ in .Net Framework   
Can't help you on the first part, but good luck I used to do C++ and from my 
understanding at least in pre 3.5 versions of the .net framework it was not 
well integrated. 
  However sa far as the proper namespace for the hashtable you would want 
the one under System.Collections. This will give you a hash table that does 
not have a specified type so you will hav to cast the objects in it each time 
they are accessed. If you look at System.Collections.Generic you will find  
Dictionary <TKey, TValue> which allows you to specify the type for the key 
and the value that the dictionary will store.  If you are simply storing a 
list of urls, the  List<T> class may be better suited for you. 

Bill

"Fred" wrote:

> Hi, all:
>         I'm new to .Net, so don't laugh at my questions if they sound
> silly.
>         Here it comes, I want to utilize classes in .Net framework
> namespace, such as system.collections. Things become simple if I'm
> coding in C#( just using ... ), however, I'm modifying a C++ program,
> and, it's MFC supported. I think what I should do is to import
> corresponding libs to introduce classes and namespaces in .Net
> framework. Am I right?
>         That's the first question. The second is, importing libs seems
> tricky, there're few examples I could follow, is it better for me to
> build a COM/DLL with C# so that I could just call it in C++?
>         It would be more convenient if some background is supplied. My
> object is to use a serializable hash class to store a large amount of
> URLs. It must be serializable, so that at the first time, I could
> build hash with URLs as keys, then dump the hash into a file. From
> then on, when I get a new URL, first I should load the hash from the
> file, next, I could check it among the URLs for existance, rebuild
> hash could be avoided.
>         As to my situation, which hash class is suitable? I've got
> system.collections.hashtable, and some
> System.Security.Policy.hash, ... Thanks a lot for you help.
>
date: Tue, 5 Aug 2008 09:19:00 -0700   author:   wdudek am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us