|
Hi,
I have a COM object that is build for x64 platform. I wanted to debug this COM object with my C# TestDriver program (also used x64 platform).
When I enable "Enabled unmanaged code debugging", the application won't start. I gave me this error:
Error while trying to run project: Unable to start program 'C:\Temp\COM\TestDriver\TestDriver.exe'.
The debugger does not support debugging managed and native code at the same time on this platform.
Everything works fine for x86 platform (of course, my COM object also build for x86 platform).
Any idea?
Cheers
|
|
|
|
|
Hi All,
I created one personal folder in outlook.Now i wanna access that personal folder calendar events from c# program.i tried this but it directly access the default calender.i want to access which i created in outlook personal folder calendar.Give me any commends regarding this.
Thanx Much in Advance...
Mohan.T
Mohan t working for N.I.C
|
|
|
|
|
I am in a bit of a pickle. I need to write a windows application using Visual Studio 2005, I have an Accpac Financial System that has an API named XAPI.
What I did was that I will add this API as a reference and then insert the using namespace for the API, I have also added the namespace System.Runtime.InteropServices as this API works with an old COM component.
Now if I retrieve a value from the DB in the button_click event everything works. If I copy that code and put it in a method, say "public object Test()" and then reference the Test() in the button_click everything works.
Now I take that same code and copy that into a Class Library. I replace all the textboxes with property values as the textboxes cannot be accessed in the library. If I run the application I get a "Error HRESULT E_FAIL has been returned from a call to a COM component."
Can someone please help me with this?? I think it has something to do with the properties but I am not sure...
Thanks in advance!!
Illegal Operation
|
|
|
|
|
Are you accessing the class library from a console application? IIRC, console projects don't have the [STAThread] attribute set for Main, while WinForms projects do. Can you check whether the code accessing your library has [STAThread] set for its Main method?
|
|
|
|
|
I checked in the Program.cs and the [STAThread] has been set. It is a windows application that needs to execute methods from an external dll...
Illegal Operation
|
|
|
|
|
Hello everyone,
Sorry for this stupid question, as I am migrated from C++ to C#. In C++ there is no concept of property, except in COM.
For static property of a class in C# (e.g. DateTime.Now), I think there is nothing special compared to a non-static property, except we need to access the property by class name other than by instance variable name?
In my usage of static property, I feel no special point compared with static function. Correct?
thanks in advance,
George
|
|
|
|
|
You know properties are getter and setters and compiled into normal methods. Say you have property named "MyProperty" which will be compiled into get_MyProperty() and set_MyProperty() .
Non-static members are instance members which requires an instance for accessing. Statics are class members and can be accessed directly.
|
|
|
|
|
Thanks N a v a n e e t h,
Besides get/set methods, static property behaves the same like static member function?
regards,
George
|
|
|
|
|
Yes.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Good to learn from you Greeeg!
regards,
George
|
|
|
|
|
static in C# is the same as C++. It's just a matter of scope.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Chris!
Christian Graus wrote: a matter of scope
Means?
regards,
George
|
|
|
|
|
George_George wrote: In my usage of static property, I feel no special point compared with static function. Correct?
Properties help avoid adding a getter and setter function for every field that you want to expose - the resulting design looks cleaner, IMO.
|
|
|
|
|
|
George_George wrote: In my usage of static property, I feel no special point compared with static function. Correct?
In fact, DateTime.Now evaluates to public static DateTime get_Now() , so it's just a static get method. You can examine this in .NET Reflector.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Hello everyone,
Here is my test program. I want to confirm that when we pass an out variable into a function, we just pass a reference, no additional copy is made?
class Program
{
struct Foo
{
public int abc;
}
static void Test(out Foo f)
{
f.abc = 200;
return;
}
static void Main(string[] args)
{
Foo f1;
f1.abc = 100;
Test(out f1);
Console.WriteLine(f1.abc);
return;
}
}
thanks in advance,
George
|
|
|
|
|
You will get 200. What's the problem here ? If you remove out , you will get 100.
|
|
|
|
|
Yes, N a v a n e e t h!
I got 200. I just want to confirm that when we pass an out variable into a function, we just pass a reference, no additional copy is made?
regards,
George
|
|
|
|
|
Yes the reference is passed and no additional copy is made.
|
|
|
|
|
Thanks N a v a n e e t h,
Question answered.
regards,
George
|
|
|
|
|
I have to do some animation (slide in / slide out) on about 5 images in c# form. For this I have placed a transparent form on which 5 panel with background images and initially set their location out of form so that they will be invisible at start. On start called a routine, which brings those into the form with slide effect. The routine is
-------------------------------------------------code-------------------------------------
void inimationStart()
{
if (this.Visible)
{
panel1.SetBounds(-300, panel1.Location.Y, panel1.Width, panel1.Height);
panel3.SetBounds(-360, panel3.Location.Y, panel3.Width, panel3.Height);
panel4.SetBounds(-400, panel4.Location.Y, panel4.Width, panel4.Height);
panel5.SetBounds(-460, panel5.Location.Y, panel5.Width, panel5.Height);
panel6.SetBounds(-500, panel6.Location.Y, panel6.Width, panel6.Height);
panel2.SetBounds(-560, panel2.Location.Y, panel2.Width, panel2.Height);
this.Refresh();
MessageBox.Show(this.Width.ToString());
for (int i = 0; i < 560; i += 20)
{
if (i < 300)
panel1.SetBounds(panel1.Location.X + 20, panel1.Location.Y, panel1.Width, panel1.Height);
if (i < 360)
panel3.SetBounds(panel3.Location.X + 20, panel3.Location.Y, panel3.Width, panel3.Height);
if (i < 400)
panel4.SetBounds(panel4.Location.X + 20, panel4.Location.Y, panel4.Width, panel4.Height);
if (i < 460)
panel5.SetBounds(panel5.Location.X + 20, panel5.Location.Y, panel5.Width, panel5.Height);
if (i < 500)
panel6.SetBounds(panel6.Location.X + 20, panel6.Location.Y, panel6.Width, panel6.Height);
if (i < 560)
panel2.SetBounds(panel2.Location.X + 20, panel2.Location.Y, panel2.Width, panel2.Height);
this.Refresh();
}
}
} ----------------------------------------------------------------------------------------
But here I cought in few problems
1. when I make the form visible all the panels are visible on the form and then suddenly disappear, whereas I have disappeared those.
2. It’s very slow.
3. some flickering
Could anybody please help me? Thanks.
abrar
|
|
|
|
|
Rather than shifting a bunch of panels, i recomend you just draw the images yourself. To get rid of flickering use double buffering. I forget exactly how you do that, but it should be an option in the designer (for your form) and its pretty easy to google.
You'll want to be drawing the images in your forms OnPaint event, and this is quite simple. You will also need a way to track the location of your pics though and you should use a timer to change these variables so that you get smooth motion, something like this perhaps:
Time myTimer = ...;
myTimer.Interval = 100;
Bitmap imageOne = ...;
int xOne,yOne;
Bitmap imageTwo = ...;
int xTwo,yTwo;
...
void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawImageUnscaled(imageOne, xOne, yOne);
e.Graphics.DrawImageUnscaled(imageTwo, xTwo, yTwo);
}
void TimerTick(object sender, EventArgs e)
{
if(xOne < XX)
xOne += 20;
if(xTwo < XX)
xTwo += 20;
this.Invalidate();
}
EDIT: If you use a timer like this and it's still too jumpy, then you're gonna need to use a better timer that the one .Net supplies. Your gonna need to go back in time to timeSetEvent and timeKillEvent from winmm.dll
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Hi all
I am developing a Voice Chat Application.....
I used DirectSound For Capturing the Audio. Using WaveFormat I am capturing the audio bytes and sending it over the client.....
My client is receiving the Audio Byte...But it is not playing.......
Can anyone tell me what will be the reason.......
Thanks in Advance
Vayanan
|
|
|
|
|
vayanan wrote: Can anyone tell me what will be the reason.......
Their volume is turned off.
Seriously, it's hard to tell if you don't give us more detail. How are you trying to play it ? Is it stored in a file first ? What does the code look like ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|