-
- C# COM entry point function
by George2
- 4 Replies
- Last post
by George2
- Hello everyone,
I am a developer from C++ COM to C# COM. I feel confused about the entry point function for a C# COM object.
In C++, we always initialize object through GetClassObject or DLLGetClassObject, but it seems C# does not need these functions
Here is a sample from MSDN.
http://msdn2.microsoft.com/en-us/library/aa645738(VS.71).aspx
So, in C# do we need to implement t
-
- Debug vs Release
by Grigs
- 12 Replies
- Last post
by OmegaMan
- Hello,
I have a Windows Forms application written in C# via VS 2003. It does 100% of what it should while in Debug mode. However, there is one thing it does not do when compiled in Release mode. There is an external .dll I have to connect to, to do a screen scrape of an AS400 application. The linking of it is as follows:
[DllImport("PCSHLL32.dll")] public static extern UInt32 hlla
-
- AppDomain creates confusion
by SunilKumar111
- 4 Replies
- Last post
by SunilKumar111
- Can any please tell me difference between AppDomain and Process in .Net context. I mean I am reading a book which says AppDomain is the new boundry for application execution and we can have more than one AppDomain in a process. If my application (means exe) is executing in an AppDomain than what is a process in which I can create another appdomain means can execute another exe. The book(Profession
-
- MAPI in C# ?
by cjr
- 3 Replies
- Last post
by Ross Dargan
- I am currently sending email from my C# windows application using System.Net.Mail by creating a SmtpClient.
However, I am being asked to use the Exchange Mail Server's "User names" instead of the actual email addresses. The SmtpClient method of sending mail does not seem to be able to do this.
I am told that another developer working with another language and development environmen
-
- watch if the file size change
by ashk1860
- 3 Replies
- Last post
by ashk1860
- hi
I need to create a watcher to rase a custom event if the size of the file changed. but I don't know the most efficient way to watch. the only way that I can imagin is to use a timer to check in a time period!!!!
thank you in advance
regards
-
- Solution Explorer where did New Folder go?
by Philip Borchert
- 1 Replies
- Last post
by Tom Meschter MSFT
- It appears that in visual Studio 2005, the new folder feature found in visual studio solution explorer has been replaced with "new filter". While I find filters fun and nice to use, I find this feature not able to do what I could with the new folder feature in 2003 We basically have a very large project and we want to create "sub-folders" off of that project as to group the different
-
- Interface, Static Events??
by uncle hammy
- 12 Replies
- Last post
by uncle hammy
- OK, I know an interface can't contain static members of any kind, so let me explain what I am trying to do, and see if anyone has any ideas how to do it... I have several business objects in my app that all have a static "ObjectAction" event. This event gets fired when an object is added, edited, or deleted, and the eventargs contain the type of action that took place. Now, I have also b
-
- HELP Needed on COM Interop
by swaroop.m
- 2 Replies
- Last post
by swaroop.m
- Hi All,
Need help with COM Interop.
I am trying to use interop and perform automation on a COM DLL.
In the process, i need to type cast an Object into a Class specified in COM DLL.
When i do the same in VB it works fine.
However when i typecast using C# , i get the following exception.
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to clas
-
- events and handlers
by TomPearson
- 9 Replies
- Last post
by TomPearson
- I have what may seem like a silly question, but hopefully someone can let me know.
If I have 3 objects, which I will call A1, A2 and A3, that all reference each other (I have a data model that is effectively a graph structure that I am modeling) and each attach to an event on a different type of object, which I will call X, so that when something happens they can all react accordingly.
-
- Help - command line error MIDL1003
by allison_h
- 2 Replies
- Last post
by allison_h
- Hi,
can anyone help me,
i am trying to create MSHtmHstInterop.dll
but im getting this error and i dont know what it means or how to fix it
c:\program files\microsoft sdks\windows\v6.0\bin\xmldom.idl(22) : fatal error C1 034: idispids.h: no include path set midl : command line error MIDL1003 : error returned by the C preprocessor (2)
-
- How do I transfer data to an Excel file
by John Woodiwiss
- 10 Replies
- Last post
by Indian Ocean
- Happy New Year to all our readers!
Hi everyone,
I have a need to write data to an Excel file.
I found a KB file, 306023, which gives a lot of information and an example that works.
I now want to add some of this code to a DLL that I am building. However, having added all the recommended References, I still get errors. Typically,
public Excel .Application m_objExcel = null ;
-
- Warnings and classes
by Nimce
- 6 Replies
- Last post
by Nimce
- Hi!
I'm new here and i've begun to learn C#.
I have Microsoft Visual Studio 2005,and I think I found some bugs:
1.
class Car
{
public int Year;
}
Why does this code create a warning (Field 'Car.Year' is never assigned to, and will always have its default value 0)
Now this warning should be ONLY with unpublic fieds in structs and classes (written in MSDN -
-
- Double or single?
by Azurewrath
- 7 Replies
- Last post
by Azurewrath
- Hi all, I want to implement a math and vector3 class. But I can't decide which value type I should use for scalars. I know that the default math library in .net uses double right But one of my friends told me that some of these functions convert it from double to float and then double again inside the chip, which would be pointless to use double. So what should I use Thanks, Aw
-
- Text file symbols
by Victor BA
- 7 Replies
- Last post
by Peter Ritchie
- I have an app that opens a text file, but i can't see the accents, instead i see something like this:
cu l es l
the problem is by reading the file or a property in the textbox where is displayed
-
- Problem showing int from another class
by Artichoker
- 4 Replies
- Last post
by Artichoker
- Hello, I am developing a console text game. Here is the problematic code for it.
Code Snippet
using System; namespace CoolGameTextClean { class Engine { private static Player MainCharacter = new Player(); public Engine() { MainCharacter.StartingLevel(); } public static void Main() { Console.WriteLine(MainCharacter.DisplayLevel.ToString()); // Displays 0. It should display 1 Console
-
- Language suggestion: try using {} catch {} finally {}
by sholodak
- 14 Replies
- Last post
by sholodak
- I would like to recommend adding a 'try using' statement. It would make code easier to read and would limit horizontal scrolling in cases of nested using statements. Also, it is easier to understand that the catch statement outside the using statement is fired only if the variable initialization fails. The alternative (wrapping a using statement in a try statement) leads to more ambiguous-looking
-
- Hashmap without unique key.
by Alberto Cardoso
- 2 Replies
- Last post
by Matthew Watson
- Hello. Im trying to make a kind of object like the Hashmap with no unique key that I could loop trough it and get a string and the indexed string. Is actually two strings hash somthing like a datatable with two strings columns. The Dictionary class looked nice (Dictionary<string,string>) but it implements unique key too. Thanks
-
- Generic Method Return Type Casting Problem
by Senthil.Elayappan
- 9 Replies
- Last post
by Solairaja
- In the below code snippet, i am trying to retun a int type from a Generic Method Add, but getting a compiler error "Cannot convert type 'int' to 'T' " I have a scenario in my project to have such implementation.
Would you give me your suggestion Do we have any workaround to implement this functionality
public class GenericCalculator
{
public GenericCalculat
-
- Helptext does not display all objects
by slyth
- 1 Replies
- Last post
by Figo Fei - MSFT
- Say I'm typing 'using System.', I'm expecting to see 'MulticastDelegate' to be displayed from the IDE since the object exists.
How come it's not then
VS 2005 Pro Edition
-
- csc.exe /doc: flag error when generating documentation.xml
by Lucidquiet
- 5 Replies
- Last post
by Sujatha Nates
- Hello,
I'm have a bit of an error when trying to output documentation xml from the command line using the /doc: output flag. I have a solution in 2005 with subproject. Some of the projects output the XML just fine, but other projects do not. The projects that do not output the XML report the following errors:
Properties\AssemblyInfo.cs(33,12): error CS0579: Duplicate 'AssemblyFileVer
-
- Serial Port
by smalamas
- 4 Replies
- Last post
by xlthim
- Hi there,
I am new in using C#. I want to make an GUI which will open a serial
port and will send data to a device. I tried out many techiques, but
nothing seems to happen. The serial device is working properly, I've
tested it in the HyperTerminal.
I am using the following code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using
-
- Format Exception
by phertel
- 1 Replies
- Last post
by Jeremy Filburn
- I have written a networked system where clients sometimes download data from the server. The clients are run all over the world and I have no control over their regional settings. Some of the clients crash with a Format Exception because dates which they download cannot be parsed on the client side. Is there some way that I can write a DateTime as some sort of universal string which can then be pa
-
- Programmatically Sign non-executable files
by Adam35413
- 3 Replies
- Last post
by Peter Ritchie
- I recently wrote a C# DLL that allowed me to sign executable files using the CAPICOM library and the SignedCode class specifically. However, the SignedCode class does not work for anything besides executables. What API/Class should I be using to sign files other then .exe's I want to sign a file and have the signature be appended, as opposed to creating a separate signature file. Thanks!
-
- Craete a windows Local user
by AamirKhurshid
- 3 Replies
- Last post
by AamirKhurshid
- hello all ,
How can i create a windows local user throgh code..
Which api Function i have to use..
looking forward ........
Regards,
Aamir
-
- A Whole Load of Questions...
by uberTraceur
- 8 Replies
- Last post
by OmegaMan
- Okay, I have done my fair share of fooling around in visual basic, but, C# is completely new to me. I'm trying to make a program which will transfer files from a thumb drive (which you select), to a folder on the computer (which is selected also.) Or, there are presets (as this program is for a friend of mine), which will select things from preset drive names and preset folders. Then, you hit tran