|
I dont know, I did a search and came up with a lot to do with Excel. But here is the address anyway: www.codeproject.com/csharp/Excel_using_OLEDB.asp
|
|
|
|
|
I have been using VC++6 IDE for a while. I just aquired Visual Studion.net.
I would like to start using the VS.NET IDE. What is the best way to open VC++6 projects in VS.NET?
|
|
|
|
|
try the VC, Managed C++, MFC messege boards
there are no facts, only interpretations
|
|
|
|
|
I think you can simply open the project with VS.NET which then offers you to convert it.
www.troschuetz.de
|
|
|
|
|
Dear sir,
i have created an array list called LiveClients.and i have a object(C1) which consists of attributes like (Thread Mythread,Endpoint Myendpoint,string Name,Socket MySocket).those properties are in a Class called client.
When i 'm going to add above C1 object into my ArrayList it raise exception
called nullpoint....,how do u solve this prob.
also can anyone tell me how can i find yahoo or msn imotion icons.i just
want those smiley's seperately in ico format.
AMAL@SLIIT
|
|
|
|
|
Do you mean NullReferenceException? This happens if you have only declared, but not initalized the ArrayList.
Have you forgotten the line liveClients = new ArrayList(); ?
_________________________________
nur Idioten brauchen einen Führer
|
|
|
|
|
//c# code:
public class Win32 {......
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public struct SP_DEVICE_INTERFACE_DETAIL_DATA
{
public uint cbSize;
public char* DevicePath;
}
[DllImport("setupapi.dll", CharSet=CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetupDiGetDeviceInterfaceDetail(
[In]IntPtr DeviceInfoSet,
[In] SP_DEVICE_INTERFACE_DATA *DeviceInterfaceData,
[Out]SP_DEVICE_INTERFACE_DETAIL_DATA *DeviceInterfaceDetailData,
[In]int DeviceInterfaceDetailDataSize,
[Out]int *RequiredSize,
[Out]SP_DEVINFO_DATA *DeviceInfoData
);
......
}
public class usbdevice {......
ptrDeviceInterfaceDetailData = (Win32.SP_DEVICE_INTERFACE_DETAIL_DATA*)Win32.GlobalAlloc(Win32.GPTR,nBytesRequired);
ptrDeviceInterfaceDetailData->cbSize = (uint)sizeof(Win32.SP_DEVICE_INTERFACE_DETAIL_DATA);
ptrDeviceInfoData->cbSize = Marshal.SizeOf( new Win32.SP_DEVINFO_DATA().GetType() );
bResult =Win32.SetupDiGetDeviceInterfaceDetail(hDevInfo,
ptrDeviceInterfaceData,
ptrDeviceInterfaceDetailData, //[out] pointer to a buffer to store the interface detail data
nBytesRequired, // the buffer size
null,
ptrDeviceInfoData);
lasterror = Win32.GetLastError();// Error number:1784. How to settle this problem????
|
|
|
|
|
I'm a delphi programmer. I have the same problem when programming, but I find a way to correct it. Take a look at following code which in bold. I hope it can help you.
const
GUID_CLASS_COMPORT: TGUID = (
D1:$86e0d1e0; D2:$8089; D3:$11d0; D4:($9c, $e4, $08, $00, $3e, $30, $1f, $73));
procedure EnumPortsWdm(AList: TStrings);
var
LGuid: TGUID;
LDeviceInfo: HDEVINFO;
LDevice: TSPDevInfoData;
LDeviceInterfaceData: TSPDeviceInterfaceData;
LDeviceInterfaceDetailData: PSPDeviceInterfaceDetailData;
LSuccess, LIsUsbDevice: Boolean;
LDeviceInterfaceDetailDataSize,
LRequiredSize: DWORD;
LIndex: DWORD;
LFriendlyName: array[0..255] of Char;
LDesc: array[0..255] of Char;
LLocInfo: array[0..255] of Char;
LComPortInfo: TComPortInfo;
begin
ClearPortsList(AList);
LGuid := GUID_CLASS_COMPORT;
LDeviceInfo := SetupDiGetClassDevs(@GUID_CLASS_COMPORT,
nil, 0, DIGCF_PRESENT or DIGCF_DEVICEINTERFACE);
if (Cardinal(LDeviceInfo) = INVALID_HANDLE_VALUE) then
begin
Exit;
end;
SetupDiGetDeviceInterfaceDetail(LDeviceInfo,
@LDeviceInterfaceData, nil, 0, @LRequiredSize, @LDevice);
LDeviceInterfaceDetailDataSize := LRequiredSize;
GetMem(LDeviceInterfaceDetailData, LRequiredSize);
try
LDeviceInterfaceData.cbSize := sizeof(TSPDeviceInterfaceData);
LDeviceInterfaceDetailData.cbSize := sizeof(TSPDeviceInterfaceDetailData);
LIndex := 0;
while True do
begin
if not SetupDiEnumDeviceInterfaces(LDeviceInfo,
nil, LGuid, LIndex, LDeviceInterfaceData) then
begin
Break;
end;
LDevice.cbSize := sizeof(TSPDevInfoData);
LDevice.ClassGuid := GUID_CLASS_COMPORT;
if not SetupDiGetDeviceInterfaceDetail(LDeviceInfo,
@LDeviceInterfaceData,
LDeviceInterfaceDetailData,
LDeviceInterfaceDetailDataSize,
@LRequiredSize, @LDevice) then
begin
Break;
end;
LSuccess := SetupDiGetDeviceRegistryProperty(LDeviceInfo,
LDevice, SPDRP_FRIENDLYNAME, nil,
PByte(@LFriendlyName[0]), sizeof(LFriendlyName), nil);
LSuccess := LSuccess and SetupDiGetDeviceRegistryProperty(
LDeviceInfo, LDevice, SPDRP_DEVICEDESC, nil,
PByte(@LDesc[0]), sizeof(LDesc), nil);
LIsUsbDevice := FALSE;
if SetupDiGetDeviceRegistryProperty(
LDeviceInfo, LDevice, SPDRP_LOCATION_INFORMATION, nil,
PByte(@LLocInfo[0]), sizeof(LLocInfo), nil) then
begin
LIsUsbDevice := (Pos('USB', LLocInfo) = 1);
end;
if LSuccess then
begin
LComPortInfo := TComPortInfo.Create;
LComPortInfo.DevPath := PChar(@LDeviceInterfaceDetailData.DevicePath[0]);
LComPortInfo.FriendlyName := LFriendlyName;
LComPortInfo.PortDesc := LDesc;
LComPortInfo.IsUsbDevice := LIsUsbDevice;
AList.AddObject(LFriendlyName, LComPortInfo);
end;
LIndex := LIndex + 1;
end;
finally
FreeMem(LDeviceInterfaceDetailData);
SetupDiDestroyDeviceInfoList(LDeviceInfo);
end;
end;
|
|
|
|
|
I'm writing a Client/Server app that uses RSA encryption. I'm triing to serialize an entire class to send across the socket. The class contains 6 byte arrays which hold encryption data.
I can serialize and send just fine, but when I receive the data and try to deserialise it I get the following error:
Decrypt: Cannot find the assembly RSASend, Version=1.0.1774.26988, Culture=neutral, PublicKeyToken=null.
Well this is of course due to the fact that the two Assemblies I'm using are different.
Is there any way to avoid this problem ?
Perhaps a better way to send this class over the socket ?
Here is my de/serialization code:
public byte [] Serialize(CipherMessage Data)
{
try
{
MemoryStream sms = new MemoryStream();
BinaryFormatter format = new BinaryFormatter();
byte [] Buff=null;
format.Serialize(sms,Data);
Buff = new byte[(int)sms.Length];
sms.Seek(0,SeekOrigin.Begin);
sms.Read(Buff,0,(int)sms.Length);
return Buff;
}
catch (Exception Err)
{
CryptoError="Serialize Error: "+Err.Message;
return null;
}
}
public CipherMessage Deserialize(byte [] Data)
{
BinaryFormatter format = new BinaryFormatter();
MemoryStream ms = new MemoryStream(Data);
ms.Seek(0,SeekOrigin.Begin);
CipherMessage message = (CipherMessage)format.Deserialize(ms);
ms.Close();
return message;
}
|
|
|
|
|
How would I traverse an array testing each individual array member for equality to a char. Below is what I have so far but it says I can't use == with char and sting:
for(int x = 0; x <= input.Length; x++)
if(input[x] == " ") word_count++;
Thanks all
kha0s
"There are 10 types of people in this world; Those that know binary and those that do not."
|
|
|
|
|
If you change the " " to a single quote, ' ', then that should help with that. You should also change your <= to just < for the Length check. Arrays start with 0 and go to Length-1.
Steve Maier, MCSD MCAD
|
|
|
|
|
Ahh PERFECT it works, thanks a lot!!
kha0s
"There are 10 types of people in this world; Those that know binary and those that do not."
|
|
|
|
|
how exactly does the algorithm for finding all the permutations of a string work in C. For example, if you have a specified length, and you have an initial string, how would one calculate all the possible permutations of that string. Any examples would be greatly appreciated
|
|
|
|
|
do you simply want a total of all permutations, or do you want to display them too?
I think I remember doing a permutation problem when I was in college...use the factorial maybe? I'm not sure if that's correct or not, but if all you need is the number, that might be a place to start.
If you need to display all of the permutations, you'll probably have to use a stack.
This not only sounds like a homework problem, but it was also posted in the wrong forum, so I'm guessing you'll get more rude remarks than help in here...
|
|
|
|
|
Programs like SMS get the video from
a remote machine and allow you to interact
as if you were on that machine
I was wondering what I would need to look into
so I could write a program using C# that allowed
a user to do the same. I am guessing that the answer
to this question is not an easy one.
Any help would be great
thanks
Will
|
|
|
|
|
I use a simple ftp client code (that I've found on the internet) in my application.
The problem is that I can't receive the WHOLE response message from some ftp servers.
I've noticed that if the server response is short (one or two lines) it works fine (Socket receive(...) method is able to catch the whole response), but when the server response is a little bit longer (i.e. GuildFTP - three lines) - only first two lines are received.
Has someone noticed the same problem?
Many thanks for help in advance.
Socket client = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);<br />
IPEndPoint ipep = new IPEndPoint(Dns.Resolve(remoteHost).AddressList[0], remotePort);<br />
<br />
client.Connect(ipep);<br />
<br />
Byte[] buffer = new Byte[1024];<br />
<br />
client.Receive(buffer);<br />
<br />
MessageBox.Show(ASCII.GetString(buffer));<br />
|
|
|
|
|
Newbie question(still getting used to C#):
HTTP/1.1 500 Internal Server Error
Server: Sun-ONE-Application-Server/7.0
Date: Tue, 09 Nov 2004 16:58:28 GMT
Content-length: 8802
Content-type: text/xml; charset=UTF-8
Optimizable: true
Connection: close
[newline]
Message Here
....
....
I want to parse the message above so that I get the 'message' part of HTTP response, I am used to java, and I would normally use a 'split' function, does this exist in C#, a split, the result is stored as a String
Berlin Brown
GIS Developer
http://www.retroevolution.com
|
|
|
|
|
Don't know if that's what you're looking for, but i'll give it a try
Take a look at the String class which offers many methods for string manipulation, e.g. the Split method.
www.troschuetz.de
|
|
|
|
|
I should have figured that, just checking, I was going to split it, then check for a zero length or 1 length string.
Berlin Brown
GIS Developer
http://www.retroevolution.com
|
|
|
|
|
|
:In c++ there is a function :"_i64toa" ,it can encoding "long" to "char" ,Is there any function in c#.net can do it like "_i64toa"?
Need you help, thanks!
|
|
|
|
|
|
Look in the documentation at the System.Convert class. This object has all sorts of functions to convert. There is an overload in there that will convert long structure data to char structure data assuming that is really what you wish (keep in mind char in the CLR is 16 bit, unicode character data type and long is 64 bit integer).
|
|
|
|
|
and save yourself some cash.
1. This forum is for C#, not C.
2. Pick up a book and read it, get glasses so you see the differnce between C & C#. You will likely see a similar example of what is required of you.
3. No, we dont do your homework, thats your job, why are you taking this course anyways, if you dont want to learn?
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
While I agree with leppie to an extent, I still hate to not help somebody coming in here with questions...
I haven't used c in a while, so I might be a little off, but you should get the idea from this (you'll probably need to check the include libraries, not sure where IsAlpha( char ) lives)
you've already declared your input, which you called imput, with a length of 100...so let's just go from there.
char imput[100]="interesting, this class of robotics";
int iLowerBound, iUpperBound;
for ( int x = 0; x < 100; x++ )
{
if (isalpha( imput[x] ))
{
iLowerBound = x;
while (x < 100 and isalpha(imput[x]))
x++;
iUpperBound = x-1;
for ( int y = iUpperBound; y >= iLowerBound; y-- )
printf("%c",imput[y]);
}
printf("%c",imput[x]);
}
I didn't test this, and really have no clue if it works...I just wrote it off the top of my head in about 5 minutes. Assuming it does work, this should be about all you need. Hope it helps...
|
|
|
|
|