|
check out a search on your pc for wininet.h
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
[System.Runtime.InteropServices.DllImport("wininet.dll")]
public static extern bool InternetGetConnectedState(IntPtr lpSFlags, int dwReserved);
|
|
|
|
|
I created a dataviewmanager because i have dataset and want to provide different views on that that dataset. Is it possible to get the rows in a dataviewmanager? That is, I want to see the contents of the dataviewmanager. Does any one have any sample code?
|
|
|
|
|
I have ccoCustomers and cboStoreLocation
Customer has multiple store Locations
if I have 2 DataTables one CUstomer(ID) and the other SotreLocation(CustomerID)
what is this best way to bind these together?
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Just reading up on "active directory - DirectoryEntry", come across this code fragment:
DirectoryEntry de = new DirectoryEntry();
String schemaNamingContext = de.Properties["schemaNamingContext"][0].ToString();
String defaultNamingContext = de.Properties["defaultNamingContext"][0].ToString();
What's:
a. schemaNamingContext
b. defaultNamingContext
Don't have anything from MSDN...
norm
|
|
|
|
|
|
|
Funny, I'm using active directory to log people on my application and I was looking for something like that.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
But, what is "naming context", it seems to me it means nothing more a LDAP path - therefore the phrase "context".
norm
|
|
|
|
|
1
2
3
probably mopre of what your looking for
nick
From what I see you get the schema for the container which maps out the organization like a xml schema.
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
i got it:
schemanamingcontext = schemanaming "container"
man, "context" is confusing, they really should named it "container" instead
norm
|
|
|
|
|
yeah ms and thier hype words
securitycontext = securitycontainer for the object (DCOM)
MTScontext == the container for the MTS object thats acts as a proxy much like Eneterprise Java Beans
need I go on...
now that I think about in my COM+ book for c++
COM+ wraps every thing with a container to proxy calls and what not and they call that...guess... ObjectContext
go figure
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
"context": something of interest resides in contexts (make sense doesnt it)
After you explaining it, I begin to look at the word "context" (and the world) differently: context==container. or more precisely, container==context (gee, that feels a lot better now)
norm
|
|
|
|
|
funny though how I didnt undertsand that I did understand so-called "Context"
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Here's a reference from MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/ad/serverless_binding_and_rootdse.asp
norm
|
|
|
|
|
Guys,
How can I call a c++ function from c#?
Many other sites say "call it as a DLL using InteropServices", but this seems like hard work. I have a single solution with two projects. One is in C++ the other is in c#. Why can't I just compile them together and have the linker resolve the references between them.
People are suggesting that you can't do this at compile time - only at run time via a DLL. But that seems crazy. Has anybody worked out how to do it>
Rob
|
|
|
|
|
|
Leppie,
So I think that you are saying that the only way to do this is at run-time - is that right? I am suprised that I can't declare a C++ function as public and have the linker resolve across the two languages.
I have given up trying to learn Microsoft C++, I think that the compiler are environment are awfull. When ever I try to use it I end up spending days trying to understand bizare error messages from the compiler or linker that give very few clues as to what might actually be wrong with the code. I am much happier with c#.
Regards
Rob
|
|
|
|
|
just expose your C code as managed C++ lib, then Add Reference. i think if you know what you're doing, it's like a hour's work. If your c++ code is managed code, just compile the "managed c++ class library". If not, just cut and paste your c++ code into a managed c++ class library - then compile and get your dll/assembly. After that, you have two options:
1. shared dll (you need to install assembly into GAC - perhaps forget it for now)
2. private dll (That's what you will do, for now)
With option 2, just do this:
1. Project menu
2. Add Reference
3. Browse (select your dll/assembly)
Then, just use it in your c# code:
using namespace XXXXX;
...
...
MyCPlusPlusClass obj = new MyCPlusPlusClass();
...
Just in case you get confused... in your managed class library (which compiles to dll):
namespace XXXXX
{
public class MyCPlusPlusClass //REMEMBER "public"
{
//your stuff
};
}
I don't think you need interop. YOu didnt develop a COM/ATL-server. For newbies, what I described is easiest and it's more efficient (by passing layers of framework code). But, if you wish to explore:
subject: RCW (Runtime callable Wrapper) - Interop
teach yrself C++/VC.net in 24 hours book (publisher: Sams)
good_luck
norm
|
|
|
|
|
Sorry, won't work. In managed C++, class is equivalent to __nogc class , and only __gc classes can be seen from C#.
Like leppie said, I would just create a MC++ wrapper for the functionality I want to expose. For a general idea, take a look at facade design pattern[^]
|
|
|
|
|
Entelecheia wrote:
I am suprised that I can't declare a C++ function as public and have the linker resolve across the two languages.
Why are you surprised? In order to use a type between languages, it must be CLS compliant. C++ functions are not CLS compliant.
|
|
|
|
|
Entelecheia wrote:
I am suprised that I can't declare a C++ function as public and have the linker resolve across the two languages.
I can't imagine why.
Why can't you rewrite the function in C# ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
There is a good artical Here
<marquee behavior="alternate">Bo Hunter
|
|
|
|
|
Hi,
I'm amost finished creating my first C# application
My application connects to a database and I want to be able to change the connectionstring without recompiling.
I have read about the app.config file but I'm having problems making i work
Are there anybody who has some tips, examples or useful links?
modified 23-Jul-20 21:01pm.
|
|
|
|
|
Your configuration file should be named application.exe.config. Replace application with the actual executable name. If you add the configuration file to the project then name it app.config and VS.NET will automatically rename it correctly when it builds the project. The file should look like...
<configuration>
<appSettings>
<add key="ConnectionString" value="the actual string goes here" />
</appSettings>
</configuration>
And in code you can access it with...
ConfigurationSettings.AppSettings["ConnectionString"]
|
|
|
|