-
- Loader Lock
by Oliver 123
- 14 Replies
- Last post
by baldmountain
- Im trying to debug my app but it comes up with the following error message:
LoaderLock was detected Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
I have no idea wat this message is about. i am using VS pro 2005 and .net framework 2.0
-
- PInvokeStackImbalance was detected
by tribal
- 14 Replies
- Last post
by sgowda
- Hi,
I keep getting this error when I try to run my project from the IDE.This does not happen when running the exe. The details specify that the Stack Imbalance was detected in a third party dll which I am using. How can I fix this.
Thanks,
tribal
A call to PInvoke function ThirdPartyDll!Namespace.ClassName.NativeMethods::ImageList_DrawEx' has unbalanced the stack. This is likely becaus
-
- Underline blues (big time)
by PaulLeBlanc
- 14 Replies
- Last post
by PaulLeBlanc
- Hi, from what I can tell you don't get underlines until manual compile, which is fine with me. My problem seems to be that the compiler won't flag local variable problems at all. Can this be To wit: class EditorTest { Foobar foo = new Foobar(); // this gets flagged and Foobar is underlined public static void Main(String[] args) { Foobar foo = new Foobar(); // this does not get flagged.
-
- error in reversestring programme
by Nithya R
- 5 Replies
- Last post
by bjreddy
- Error 1: 'reversestring1.Class1.ProgrammingTest.ReverseString(string)': not all code paths return a value
y iam getting this error.please reply.thanks in advance.
-
- Naming Conventions
by Traps
- 1 Replies
- Last post
by Wole Ogunremi
- Can someone please explain or provide a link on how I should be naming my variables, classes, etc.... For example, when to capitalize, when not to capitalize, using underscores.... etc......
I know I could name it whatever I want. But I would like to follow the standards that "professionals" use.
-
- how to eliminate a horizontal scroll bar in a treeview???
by ctssoms
- 7 Replies
- Last post
by bipi
- the horizontal scroll bar is getting displayed unneccessarily..
i need only the vertical scroll bar.
-
- Group Policy
by dickP
- 2 Replies
- Last post
by dickP
- How do I access Group Policy Objects programmatically For example I want to get a list of OUs.
Cheers
-
- Calling external dll which exposes a class
by Ray Z. Yang
- 9 Replies
- Last post
by Peter Ritchie
- Hi all,
I have a custom dll which returns a class pointer from its exported function. The calling in C# is similar to this:
Code Snippet
public interface IUnknown { unsafe ulong QueryInterface(ref Guid riid, out IntPtr ppv); ulong AddRef(); ulong Release(); };
public interface IClass : IUnknown { bool GetVersion(ref VERSION_INFO v
-
- How do you comment your code?
by dabd
- 5 Replies
- Last post
by Robert C. Barth
- I am mostly used to writing and documenting Java code. What is the standard practice for documenting C# code with VS 2005 Any Javadoc like tools Where can I find guidelines and examples of commented code Thanks.
-
- Instantiating a generic object without a default constructor?
by GroZZleR
- 9 Replies
- Last post
by Thomas Danecker
- Hey all, I have a class, Entity, that accepts a parameter in its constructor. For simplicity's sake, let's say it looks like this:
Code Snippet
public class Entity { int number; public Entity(int number) { this.number = number; } } I'm trying to have a factory create these objects through a generic method:
Code Snippet
public T Create<T&
-
- Connection to SQL Server
by Idanz
- 4 Replies
- Last post
by Idanz
- Hello,
I'm using VS2005 Pro.
I would like to connect to MS SQL Server (2005) via C#.
I tryed to create a "DataBase Project" under Visual C# category, but I got error number 40: "could not open a connection...", although the details are correct.
How can connect to a database with C#
by the way, I want to do this with ConnectionString.
Thanks, Idan.
-
- Represent string as a object
by ijrr
- 8 Replies
- Last post
by frederikm
- Hello,
How can I represent a string as an object "String" is not working, because it always returns a string(value type).
I have sucessfully implemented it by creating a "Text" class with a string property, but I was wondering if there isnt any other way to do it, using existing classes.
Thanks.
-
- Serial Com Port Availability
by rutlean
- 8 Replies
- Last post
by rutlean
- Does anyone know of an easy way to check com port availability using System.IO.Ports in framework 2.0 I am looking for a way that should be easier than this:
public bool IsComAvailable( string com)
{
string sPort = @"\\.\COM" + com;
uint securityAttributes = 0;
IntPtr hPort;
bool now = cwSerial.IsOpen;
hPort = CreateFile(sPort,0,FILE_SHARE_READ | FILE_
-
- new to arrays
by Party_Boy
- 2 Replies
- Last post
by Party_Boy
- I am learning arrays and have a program that needs some help. What I am trying to do is enter the miles of a trip then get a ticket price. For example 0-99 miles would be $25, 100-299...$40,...300-499,...$55 farther than 500 miles is $70. Here is what I have any pointers would be appericated. Thanks using System; public class Miles { public static string GetMiles() { string Miles; Cons
-
- new to c# and small compile error
by David j
- 3 Replies
- Last post
by David j
- I'm new to codeing and i read some java books and i understand that c# and java is very simluer
well heres my problem
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Delete_Dir_tool
{
public partial class Form1
-
- Class with Indexer, Help!
by FelixRMT
- 16 Replies
- Last post
by FelixRMT
- Hi, i'm pretty new to c# so maybe this question happend to be a little silly. Ok to my question now: Yesterday i read some pages about indexers in classes including the msdn page and i couldnt find how exactly to write the code so i can access the content like this:
Code Snippet
string name = persons[0].Name; int age = persons[0].Age; persons[0].Name = "some name"; pe
-
- Removing items in a list while iterating through it
by J Andrews
- 14 Replies
- Last post
by jgalley
- In this code, I get a SystemInvalidOperation execution and I know why. List<int> list = new List<int>(); for (int i = 1; i < 10; i++) { list.Add(i); } foreach (int i in list) { list.Remove(i); } I replaced the foreach with for: List<int> list = new List<int>(); for (int i = 1; i < 10; i++) { list.Add(i); } for (int i = 0; i < list.Count; i++) { int remove = list ;
-
- how to convert one Struct to other Struct
by vennag
- 5 Replies
- Last post
by sri_dotnet
- i have two Structs i want convert one Struct to other Struct
both Structs are same schma
check my following example
ple give me solution for this problem
thanks
/// MyNamespace1.MyStruct1
namespace MyNamespace1
{
public struct MyStruct1
{
public int no;
public string FName;
public string LName;
}
}
///===========
-
- Read/Modify/Add Lines
by StanleyE
- 3 Replies
- Last post
by James Curran
- Hello all,
I am creating a windows application program that reads a text file in which my console program creates ¡°It takes a person name, gender, weight, and height.¡± What I want to do in the windows application is read that file, and ask the user to input a test score for that person and then add it to that person category in the text and save it.
For example
Console Version o
-
- Why is everything running so slow?
by cybercrypt13
- 8 Replies
- Last post
by vampiretap
- I have Visual Studio SP .050727-7600 and have a project open with 3 unit tabs. I've noticed that as I type the * symbol on the tab showing me that I need to save, goes away and comes back, goes away and comes back for every keystroke I hit.
Can anyone tell me what is going on Because currently I'm about to just give up on the Visual Studio stuff. I'm coming from a version of Delphi that is 4 y
-
- Terminate an object?
by learning33
- 4 Replies
- Last post
by Figo Fei - MSFT
- If I've created an object that I needed for some part of the code, but is later not needed, is there any way I can close/terminate the object The same question for ordinary variables.
-
- can't publish / release
by tece
- 0 Replies
- Last post
by tece
- Hello there! Whenever i try to consume webservices via VS2005->C#/C# Express+SP1 i can't publish / release my projects. Debugger runs fine and everything works as it should. As my Web Reference i use a PHP-Script with WSDL&DISCO. Whenever i try to release, the following errormessage breaks it: "The specified task executable could not be run. The specified executable is not a valid Win
-
- InvalidOperationException
by Sniper167
- 14 Replies
- Last post
by sirjis
- I got an Exception on this line: " whois.Lookup(listBox1.SelectedItem.ToString());" and I don't know what to do...
System.InvalidOperationException was unhandled Message="Cross-thread operation not valid: Control 'listBox1' accessed from a thread other than the thread it was created on."
So I tried this:
private void setListBoxSelectedItem( Strin
-
- Syntax for chaining constructors in C# Language Specification
by gi-m
- 14 Replies
- Last post
by gi-m
- The C# Language Specification 1.2 (Sections 1.6.3 Base Classes and 1.6.6 Other function members shows a syntax for chaining constructors that doesn't seem to work where what follows the ':' is the name of a different constructor (either in the base class or it seems even a different constructor in the current class ) . I've tried several variations on this syntax with no succes. I get an error on
-
- Basic unboxing question
by Heraclito
- 3 Replies
- Last post
by Figo Fei - MSFT
- Hello,
This code fails.
//Field1 is smallint in a sqlserver table.
DataRow r;
int c = ( int )r[ "Field1" ];
"Specified cast is not valid."
Hm, this should be an implicit conversion, data loss is not posible.
If the database administrator decide that Field1 can be smaller and chage it from "int" to "smallint" this would