|
|
Aside from what mav said, there is also audio support built into DirextX. Check out the list of things you can do with DirectX audio here[^].
- Nick Parker My Blog | My Articles
|
|
|
|
|
when i execute the following Query in Query Analyzer,it return 61 Rows.But it return 91 Rows in DataSet.
Query:
"set dateformat dmy select distinct T.DepNo,H.TranNo, H.TranType, T.ChqDepNo, H.TranRef, H.TranDate, T.BankCcy, T.ExRate, T.LAppAmt, T.AppAmt, H.IsReconciliation from tblCashHdr H,tblMultipleTender T where H.BankCode= T.BankCode and T.BankAcct='121105' and H.MerchCode='001' and H.TranDate <='13/09/2004' and H.TranDate>'01/01/04' order by H.TranDate"
Pls Help me,
Kyaw Soe Khaing
|
|
|
|
|
I'd say your date comparisons are interpreted differently. Are you sure your "set dateformat dmy" is handled correctly in your program?
mav
|
|
|
|
|
Hi,
is there any possibility to call a method by Name?
Example:
<br />
private void Run()<br />
{<br />
string vMethod = "Form1_Close";<br />
string vParam1 = "";<br />
string vParam2 = "System.EventArgs.Empty";<br />
<br />
RunMethod(vMethod,vParam1,vParam2);<br />
}<br />
<br />
public void RunMethod(string AMethodName,params string[] AParameter)<br />
{<br />
}<br />
<br />
|
|
|
|
|
You'll have to use reflection for that. You need a System.Reflection.MethodInfo object of the method in question (can be retrieved using Type.GetMethod() ) and then call Invoke() on the result.
Regards,
mav
|
|
|
|
|
As mav pointed out, you will need to use reflection. Here is a quick example to get you going:
MethodInfo mi = typeof(Form).GetMethod("Close",
BindingFlags.Instance | BindingFlags.Public);
if(mi != null)
mi.Invoke(this, null);
- Nick Parker My Blog | My Articles
|
|
|
|
|
Why do I get this error???
currency.cpp(72) : fatal error C1004: unexpected end of file found
/* Currency equivalence to the Dollar*/
#include <stdio.h>
float Australian_Dollar; //Australian Dollar
float Euro; //Euro Dollar
float British_Pound; //British_Pound Dollar
float Japanese_Yen; //Japanese_Yen Dollar
float Swiss_Franc; //Swiss_Franc Dollar
/* Dollar conversion */
int main(void)
{
/* 13 */
int menunum; /*Defines the menunum as an integer for the scanf */
int final1;
float count;
{
while (final1 != 0)
printf (" Select a currency by entering a the number beside the currency. \n\n");
printf(" Enter q to quit.\n\n");
printf (" 1. Australian Dollar \n");
printf (" 2. Euro \n");
printf (" 3. British Pound \n");
printf (" 4. Japanese Yen \n");
printf (" 5. Swiss Franc \n"); /* 28 */
scanf("%f", &menunum); /* 30 Users enters the number on the menu bar */
if (menunum == 1){
printf("%f\n", Australian_Dollar);
} /* Australian_Dollar */
else if (menunum == 2) {
printf("%f\n", Euro);
}
else if (menunum == 3) {
printf("%f\n", British_Pound);
} /* 41 British_Pound */
else if (menunum == 4) {
printf("%f\n", Japanese_Yen);
} /* Japanese_Yen */
else if (menunum == 5) {
printf("%f\n", Swiss_Franc);
} /* 51 Swiss_Franc */
else {
printf("Choose another or quit.\n");
}
Australian_Dollar = 1.43; // 50 Define Australian dollar
Euro = 0.83; // Define Euro currency
British_Pound = 0.55; // Define British Pound
Japanese_Yen = 110.9; // Define Janpanese Yen
Swiss_Franc = 1.28; // Define Swiss Franc
scanf("%f", &final1); /* 30 Users enters the number on the menu bar */
return 0;
}
|
|
|
|
|
1.) Why do you ask a CPP question in the C# forum?
2.) Why don't you give a file to include at the very start of your code?
Mav
|
|
|
|
|
|
I have problem in crystal report,exception text below:
************** Exception Text **************
System.IO.FileLoadException: The located assembly's manifest definition with name 'CrystalDecisions.Shared' does not match the assembly reference.
File name: "CrystalDecisions.Shared"
at CRTest.Viewer..ctor(String reportFilePath, String param1)
at CRTest.ParamForm.okBt_Click(Object sender, EventArgs e) in d:\myprogram\reporttest\crtest\paramform.cs:line 92
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
=== Pre-bind state information ===
LOG: DisplayName = CrystalDecisions.Shared, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
(Fully-specified)
LOG: Appbase = C:\Program Files\FE-Creation\CRTest\
LOG: Initial PrivatePath = NULL
Calling assembly : CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304.
===
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: CrystalDecisions.Shared, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
LOG: Attempting download of new URL file:///C:/Program Files/FE-Creation/CRTest/CrystalDecisions.Shared.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Build Number
////////////
Please tell me about solve this problem.
Thanks.
สวัสดีครับ
|
|
|
|
|
It looks like your app referenced a version of Crystal Reports (9.1.5000.0) and the version of Crystal Reports that's installed on the machine your running your app is different. You must have the same version of the .DLL's on the target machine as what you developed your app against.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I create a object which inherits from TextBox class,I hope no contextMenu display when click mouse right button in the new object. How to cancel the event or cancel the contextMenu !
|
|
|
|
|
Create a new ContextMenu without any items and assign it as the ContextMenu for your TextBox like this.
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
ContextMenu cm = new ContextMenu();<br />
myTextBox1.ContextMenu = cm;<br />
}
|
|
|
|
|
Actually it would be better to do this within the class, that way you don't have to worry about it if you want to do use it again somewhere else.
public class TextBoxEx : TextBox
{
ContextMenu cm = null;
public TextBoxEx()
{
cm = new ContextMenu();
base.ContextMenu = cm;
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Anyone know how to get the Full Path of a process in the Process List
i Tried getting it's start info and .WorkingDirectory but it was all blank.
Sample:
Process[] xi= Process.GetProcessesByName(proc);
ListViewItem fo = applist.Items.Add(xi[0].ProcessName.ToString());
string dir = xi[0].StartInfo.WorkingDirectory.ToString() + xi[0].ProcessName.ToString() + ".exe";
|
|
|
|
|
Is there anyway to programmatically limit an application to one cpu?
I have a third party tool that dies on multiprocessor computers but it works great on one processor.
Any ideas?
|
|
|
|
|
Is your application multithreaded? It could be that your code is not actually thread-safe, but you haven't actually tested it enough on uniprocessor machines to see it fail.
|
|
|
|
|
On Task Manager you can use "Set Affinity..." menu to limit it to only one CPU.
There are API calls to control processor affinity.
Yes, even I am blogging now!
|
|
|
|
|
There's a Win32 API function SetProcessAffinityMask
Maybe that can help
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Sweet, thanks for the quick replys.
Arun
My application that uses the third party tool is not multithreaded.
Daniel
Yeah, I saw that in the task manager, that's what led me to believing that the multi cpu was the problem because when I did set the affinity to just one cpu it works great.
parths
Sweet, I'll have to try that out and see if I can limit it using that call.
UPDATE:
I tried that SetProcessAffinityMask method and it worked like a charm. I added what I did to the www.pinvoke.net/[^] collection. Love that site. Thanks for you help.
|
|
|
|
|
I'm in a somewhat sticky situation.
I'm developing an Explorer Bar (for IE). In my implementation, I used a few singletons for very important (core) classes which are, by design, singleton. I guess I didn't want to have to manage parent-child relations for conceivably every object I worked with, but it seems like that was a bad decision. This worked okay until I realized that new windows in IE (such as created by Ctrl-N or File->New Window) are running in the same process, and since the singleton pattern I'm using does so with a static accessor (get) property, this system fails as I believe the two instances of the Explorer Bar are running in the same AppDomain because they're running in two different threads of the same IE process. So basically, instead of having separate singletons per thread group, then end up sharing the same singleton, which is bad for Windows Forms objects.
The kinda tricky thing is that my Explorer Bar is multi-threaded, so I can't just implement my singleton accessor using a hashtable keyed on the thread ID. If there were a way to access a thread group ID, or some sort of way to figure out which thread ID or IE window owns that particular CLR instance, that would be helpful.
So any suggestions, managed or unmanaged, would be helpful. Maybe I simply need to rearchitect everything, even though now really isn't the best time for that. I'd rather be able to add a few lines into my singleton accessor (Singleton.Instance) instead.
Thanks!
Arun
|
|
|
|
|
Hello
I have an object. This object contains an enum value, but I do not know which type the value is. I can find out by asking GetType.
The problem is that the object can contain different kinds of enums. All these enums inherit from int, and I want to know the value of this int.
How do I get the value of an object, when I know that the object contains an enum value of type GetType?
Programically(pseudo code), it can be written like:
intGetIntFromEnum(Type type, string enumString)
{
object enumObject = Enum.Parse(type, enumString);
return (int)enumObject; // Here it fails..., even though the enumobject's type is inheriting from int
}
Gooky
|
|
|
|
|
That should work! I use very similar code in a custom XML serializer/deserializer I wrote. This also works:
<br />
MessageBox.Show(((int)Enum.Parse(typeof(AnchorStyles), "Left")).ToString());<br />
It displays "4". Maybe enumObject is returning null , perhaps because the enumString is incorrect?
|
|
|
|
|
Hehe..
Playing a little around....
System.Convert.ToInt32(enumObject) works perfect. Thanks anyway
Gooky
|
|
|
|