Click here to Skip to main content
15,901,122 members
Home / Discussions / C#
   

C#

 
GeneralLooping through all controls on a webform Pin
caheo8-Jun-04 7:29
caheo8-Jun-04 7:29 
GeneralRe: Looping through all controls on a webform Pin
Colin Angus Mackay8-Jun-04 7:50
Colin Angus Mackay8-Jun-04 7:50 
GeneralRe: Looping through all controls on a webform Pin
caheo8-Jun-04 8:12
caheo8-Jun-04 8:12 
GeneralRe: Looping through all controls on a webform Pin
Colin Angus Mackay8-Jun-04 8:22
Colin Angus Mackay8-Jun-04 8:22 
GeneralRe: Looping through all controls on a webform Pin
Heath Stewart8-Jun-04 8:41
protectorHeath Stewart8-Jun-04 8:41 
GeneralRe: Looping through all controls on a webform Pin
Dave Kreskowiak8-Jun-04 7:56
mveDave Kreskowiak8-Jun-04 7:56 
GeneralRe: Looping through all controls on a webform Pin
Heath Stewart8-Jun-04 8:18
protectorHeath Stewart8-Jun-04 8:18 
GeneralRe: Looping through all controls on a webform Pin
Dave Kreskowiak8-Jun-04 8:47
mveDave Kreskowiak8-Jun-04 8:47 
GeneralRe: Looping through all controls on a webform Pin
Heath Stewart8-Jun-04 8:48
protectorHeath Stewart8-Jun-04 8:48 
GeneralRe: Looping through all controls on a webform Pin
Andy Brummer8-Jun-04 8:40
sitebuilderAndy Brummer8-Jun-04 8:40 
GeneralPeriod key in numpad Pin
machocr8-Jun-04 5:34
machocr8-Jun-04 5:34 
GeneralRe: Period key in numpad Pin
Heath Stewart8-Jun-04 5:45
protectorHeath Stewart8-Jun-04 5:45 
GeneralRe: Period key in numpad Pin
machocr8-Jun-04 6:37
machocr8-Jun-04 6:37 
Questionwindows that don't receive focus?? Pin
jremignanti8-Jun-04 5:32
jremignanti8-Jun-04 5:32 
AnswerRe: windows that don't receive focus?? Pin
Heath Stewart8-Jun-04 6:06
protectorHeath Stewart8-Jun-04 6:06 
Questionasp.net script timeout? Pin
lelelele8-Jun-04 5:13
lelelele8-Jun-04 5:13 
AnswerRe: asp.net script timeout? Pin
Heath Stewart8-Jun-04 6:00
protectorHeath Stewart8-Jun-04 6:00 
GeneralCopy A Fixed String Buffer Into A Struct Pin
dgiljr8-Jun-04 5:05
dgiljr8-Jun-04 5:05 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
Heath Stewart8-Jun-04 5:53
protectorHeath Stewart8-Jun-04 5:53 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
dgiljr8-Jun-04 6:24
dgiljr8-Jun-04 6:24 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
Heath Stewart8-Jun-04 6:31
protectorHeath Stewart8-Jun-04 6:31 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
dgiljr8-Jun-04 7:01
dgiljr8-Jun-04 7:01 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
Heath Stewart8-Jun-04 8:17
protectorHeath Stewart8-Jun-04 8:17 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
dgiljr8-Jun-04 10:32
dgiljr8-Jun-04 10:32 
Heath,

Thanks for all your help. I finally figured out how to cast a string into a struct thanks to your help. Here is the code I finsally came up with.

class Class1
{

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct MyStruct
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=4)] public string fname;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=4)] public string lname;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=7)] public string phone;
}

public static void Main()
{
string buffer = "abcdefgh2223333";
IntPtr pBuf = Marshal.StringToBSTR(buffer);
MyStruct ms = (MyStruct)Marshal.PtrToStructure(pBuf,typeof(MyStruct));
Console.WriteLine("fname is: {0}",ms.fname);
Console.WriteLine("lname is: {0}",ms.lname);
Console.WriteLine("phone is: {0}",ms.phone);
}
}

I am going to post this bit of code on the site.Laugh | :laugh:

Diego
Generaltextbox control with multi colored rows Pin
gmahesh8-Jun-04 2:05
gmahesh8-Jun-04 2:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.