|
my com (use c# and localserver) implement the interface ITest
[Guid("39c13a4d-011e-11d0-9675-0020afd8adb3")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
ITest
{
void fuc0( ref System.Guid riid, [MarshalAs(UnmanagedType.Interface)]out object ppvObject);
void fuc1(ref System.Guid riid, [MarshalAs(UnmanagedType.IUnknown)]out object ppUnk);
void fuc2();
}
public CTest:ITest
{
void fuc0( ref System.Guid riid,out object ppvObject)
{
ppvObject = this;
}
void fuc1(ref System.Guid riid,out object ppUnk)
{
IntPtr pSite = IntPtr.Zero;
IntPtr pUnk = Marshal.GetIUnknownForObject(this);
Marshal.QueryInterface(pUnk, ref riid, out pSite);
Marshal.Release(pUnk);
Marshal.Release(pUnk);
ppUnk = pSite;
//ppUnk= this;
}
void fuc2()
{
MessageBox.Show("fuc2 ok");
}
C++ calls
ITest:IUnknown
{
HRESULT fuc0(REFIID riid, LPVOID* ppvObject);
HRESULT fuc1(REFIID riid, LPUNKNOWN *ppUnk);
HRESULT fuc2();
}
fuc0 's param riid = IDD_ITest ,return OK,
fuc1's param riid = IDD_IUnknown,return 0xc0000005,ppUnk == NULL;
fuc2 return ok。
have many try,i find if the param is "LPUNKNOWN *ppUnk " will return 0xc0000005.
if i regist for InprocServer will have not these problem.
help please
|
|
|
|
|
Hi everyone
I have been asked to create a dashboard for tracking sells of a company and thier preformace. there are two things that has complicated the matters. one that it has to use directx for the Texture of the pictures and it has to be a executive dashboard using C#.
I was not able to find any material on executive dashboard let alone one with Directx.
if someone can help me out here, it would be great
|
|
|
|
|
homer simpsom wrote: I was not able to find any material on executive dashboard
Well, that's just a terminology. They just want a windows app
Why does it need DX ? That seems silly to me.
Christian Graus - C++ MVP
|
|
|
|
|
Well that is excally the problem.
I am just wondering as how one would create a normal Dashboard. there are not that many material on that.
even a widget would be fine at this point but there are not many sources for that nither on C#
|
|
|
|
|
What is a dashboard ?
Christian Graus - C++ MVP
|
|
|
|
|
I did some work for a client that used Dundas for the exact same thing.
|
|
|
|
|
Hi
Im working on socket connection.
client will send data to the server at some regular intervals.
how the client can identify if the ethernet cable is unplugged (client has to show some message "cable disconnected". if cable is plugged again. It should detect it automatically has to continue the task again.
Please give ur answers with some sample code/link
Thanks and Regards,
Srini
|
|
|
|
|
The recommended way to do this with V2.0 of the framework is to use the System.Net.NetworkInformation namespace.. This sample should get you started:
public class NetInfoTest<br />
<br />
{<br />
public static void Main()<br />
<br />
{<br />
try<br />
<br />
{<br />
DumpIPAddresses();<br />
<br />
NetworkChange.NetworkAvailabilityChanged += OnNetworkAvailabilityChanged;<br />
<br />
NetworkChange.NetworkAddressChanged += OnNetworkAddressChanged;<br />
<br />
Console.ReadLine();<br />
}<br />
<br />
catch (Exception e)<br />
<br />
{<br />
Console.WriteLine(e);<br />
}<br />
<br />
finally<br />
<br />
{<br />
Console.ForegroundColor = ConsoleColor.Green;<br />
<br />
Console.BackgroundColor = ConsoleColor.Black;<br />
}<br />
}<br />
<br />
<br />
public static void OnNetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)<br />
<br />
{<br />
if (e.IsAvailable)<br />
<br />
{<br />
Console.ForegroundColor = ConsoleColor.Green;<br />
<br />
Console.WriteLine("Network Available");<br />
}<br />
<br />
else<br />
<br />
{<br />
Console.ForegroundColor = ConsoleColor.Red;<br />
<br />
Console.WriteLine("Network *NOT* Available");<br />
}<br />
}<br />
<br />
public static void OnNetworkAddressChanged(object sender, EventArgs e)<br />
<br />
{<br />
Console.ForegroundColor = ConsoleColor.Red;<br />
<br />
Console.BackgroundColor = ConsoleColor.Yellow;<br />
<br />
Console.WriteLine("Address change event at {0}", DateTime.Now.ToString());<br />
<br />
Console.ForegroundColor = ConsoleColor.Green;<br />
<br />
Console.BackgroundColor = ConsoleColor.Black;<br />
<br />
DumpIPAddresses();<br />
}<br />
<br />
public static void DumpIPAddresses()<br />
<br />
{<br />
<br />
NetworkInterface[] NetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();<br />
<br />
<br />
foreach (NetworkInterface NI in NetworkInterfaces)<br />
<br />
{<br />
<br />
if (NI.NetworkInterfaceType == NetworkInterfaceType.Ethernet)<br />
<br />
{<br />
Console.WriteLine(Environment.NewLine);<br />
<br />
Console.WriteLine(Environment.NewLine);<br />
<br />
<br />
Console.WriteLine(NI.Name + " " + NI.Description);<br />
<br />
Console.WriteLine("-------------------------------------------------");<br />
<br />
<br />
IPInterfaceProperties IPProps = NI.GetIPProperties();<br />
<br />
<br />
UnicastIPAddressInformationCollection UnicastAddresses = IPProps.UnicastAddresses;<br />
<br />
foreach (UnicastIPAddressInformation uaddr in UnicastAddresses)<br />
<br />
{<br />
<br />
if (uaddr.Address.AddressFamily == AddressFamily.InterNetwork)<br />
<br />
Console.WriteLine("\t" + uaddr.Address.ToString());<br />
}<br />
}<br />
}<br />
}<br />
}<br />
Keep in mind availability here is based on the state of the network adapter. This does not tell you the reach of your connection (ie. connected to the internet, a managed network, etc)
You can use "NetworkAvailabilityChanged" and "NetworkAddressChanged" events, for reconnect operation.
Thanks Mike Flasko for code example;)
|
|
|
|
|
Hello everyone!
I have a C# project on a MS card, since hard drives suck...
But I don't have enough space for the big .PDB files, so where's the setting to change the path? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Lord Kixdemp wrote: But I don't have enough space for the big .PDB files, so where's the setting to change the path?
There isn't one, I don't believe. You need to move the project to a drive that has enough space.
Perhaps you need to buy a portable hard drive...
Christian Graus - C++ MVP
|
|
|
|
|
Christian Graus wrote:
Perhaps you need to buy a portable hard drive...
They aren't that expensive now
|
|
|
|
|
LOL!!!
isCheap(8GB, $117.99) == false
Or were you talking about something else?
Windows Calculator told me I will die at 28.
|
|
|
|
|
|
You're probably a professional programmer and earn more than $10 bucks an hour, but I only get $5.75 and work only on Saturdays...
Windows Calculator told me I will die at 28.
|
|
|
|
|
Lord Kixdemp wrote: I don't have enough space for the big .PDB files, so where's the setting to change the path?
Clear out any temporary files you don't need or upgrade the hard drive. Like Christian said, a portable drive could be an option, too.
|
|
|
|
|
HI,
i would like to take the RGB value from a whole picture then convert it into HSI values. Please help me. Thanks in advance.
|
|
|
|
|
Tried Google?[^] Take a look at the first result.
|
|
|
|
|
One of my image processing articles converts to HSL, is HSI the same ( Luminance == Intensity ??? ). IF not, you can just change the algorithm used and reuse my code. Just search CP for Graus Image.
Christian Graus - C++ MVP
|
|
|
|
|
Christian Graus wrote: One of my image processing articles converts to HSL, is HSI the same ( Luminance == Intensity ??? ).
That's correct. There's HSI/HSL, and HSB/HSV. The most noticeable effective difference between the 2 is that HSI/HSL goes from white to black on the luminence scale, with the "pure" color in the center, and HSB/HSV has the highest brightness be the pure color (when saturated).
|
|
|
|
|
thanks for your help. but how to get RGB value of a whole picture that we input?
|
|
|
|
|
Is there any algo or example (code) of how to convert MIDI file to eg Guitar Tablature?
|
|
|
|
|
I wouldn't have said that's an algorithm, it's really a rendering detail. Nothing is changed, the note is just rendered as tab.
Christian Graus - C++ MVP
|
|
|
|
|
It is not totally a rendering detail since each note can be rendered in several places
|
|
|
|
|
No, you're wrong. MIDI has no concept of the same note living in more than one place, so it doesn't contain any info about how to play the note on guitar. No system that I have seen does a good job of choosing 'default' fingerings, you always end up having to edit them. Either way, whatever fingering is chosen, becomes part of the metadata of the new file format, but as MIDI doesn't support it, it becomes another rendering details specific to the new format. And, if it was in the MIDI file, then it would be a rendering detail of the MIDI file, instead of the new format being used.
Christian Graus - C++ MVP
|
|
|
|
|
Christian Graus wrote: No, you're wrong. MIDI has no concept of the same note living in more than one place, so it doesn't contain any info about how to play the note on guitar.
Why am I wrong, just because I say that coverting MIDI to TAB would not be entirely a rendering detail ? I was just pointing out that there are different rendering possibilities and that it is not as simple as that.
Christian Graus wrote: No system that I have seen does a good job of choosing 'default' fingerings, you always end up having to edit them.
I was talking about that algorithm.
Regards
|
|
|
|