|
Thanks Adam, FillRectangle(brush, x, y, 1, 1) does the job . Hope the function doesn't have too much overhead in comparison to SetPixel.
|
|
|
|
|
|
gavinJeffrey wrote:
Hi,
Erm, Hi
Can we help?
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
I pushed enter to go to a new line but instead it posted the page (not the first time this has happened either). Yeah i did have a question but I figured it out. I also went and deleted my post straight away after I realized what I had done - dont know why it is still here though - just one of those days I guess.
|
|
|
|
|
Hi,
i want to embed a signed windows forms control (assembly with strong name, using a .snk key pair) into a html page. Using the normal <object>-tag works fine with the unsigned control, but doesn't work with the signed one! The signed control doesn't even open! In both cases i used the same html code. Is there information missing (e.g. about the key pair)?
Thanks a lot for your help!
Fridtjof
|
|
|
|
|
Hi,
here some additional informations:
1. I used sn -k key.snk for generating the key pair.
2. Then I used an attribute in the AssembyInfo.cs file to sign the control:
[assembly: AssemblyKeyFile("key.snk")]
3. In the html page the code
<object id="A" classid="http:ALib.dll#ALib.MyACtl"
width="568" height="416">
</object>
worked fine with the unsigned control. I used exactly the same code with the encrypted control. It seems to me that Internet Explorer cannot find the class "ALib.MyACtl" any more. Maybe since it is encrypted now???
Thanks for any advice,
Fridtjof
|
|
|
|
|
Hello,
I write a C# application MyApp.exe
MyApp need to read the version of an exe written in c++(VC6++)
I try with Assembly.loadFile("path\\app_vc6.exe")
but I get an error
Assembly.loadFile work corectly with an C# exe
did someone have an idea how to do it?
|
|
|
|
|
The Load methods of the Assembly type can only be used with .NET assemblies. To get the version info for any file, use: System.Diagnostics.FileVersionInfo.GetVersionInfo(fileName)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello Everybody, this is my first time posting to the forums, so... "Hi, My name is John, and I'm a code-aholic..."
I have a question about COM performance in .Net applications. I am trying to write a program interface's with Apple's COM library for the iTunes app on windows in order to get access to the library of tracks and I am having some serious performance issues.
I am basically trying to load the library into a typed Dataset for easier manipulation in C# as the COM interface is pretty limited, and it is taking about 10 minutes to load the entire library. I am using a foreach loop over the library's Tracks collection to add them into the dataset.
I was just wondering if anyone else out there has done anything with the iTunes interfaces and if so if you have any tips on how to improve performance???
|
|
|
|
|
Can you specify the sort order of a hashtable? I’m using a string as the key and a home made class as the value.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
System.Collections.Hashtable does not support sort order. It stores the data as Key, value pair.
Though I just found an article dealing with what you want.
Hashlist - Hashtable meets ArrayList
[^]
Hope this helps you.
|
|
|
|
|
Thanks!
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
Hi,
I want to export some data from an Excel file to a Database.
How can I connect programmatically to Excel?
How can I export from Excel to Databse?
|
|
|
|
|
I suggest you do a search for excel on codeproject. I found lots of useful articles on CP about this. I cannot remember the name of the article, but there is a good one on connecting to Excel using ODBC which I think will help you a lot, as you could load this information into a dataset, then connect to sql, etc.
|
|
|
|
|
Thanks.
But I couldn't find so in CP.
|
|
|
|
|
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."
|
|
|
|
|