|
Sounds like what you are really talking about it the echo from a modem, the serial port itself has no echo. If I am right it all depend on the modem you are using. Most "Hayes" modems use &E0 and &E1.
|
|
|
|
|
Hi!
I found this text when I serched MSDN for "unmanaged exceptions". Does anyone knows what it means?
""
Managed Code
In managed code, you cannot continue execution in the same thread after an unhandled exception. The thread terminates. If it is the program thread, the program itself terminates.
""
I have an application that simply terminates, NO exceptions, NO fault codes, NO dialog box saying: "an unhandled excep..."
|
|
|
|
|
Hi!
When does this occurr? Does your application use interop? In that case chances are that something is wrong there (struct or function declarations slightly wrong).
But without any code it's impossible to say for sure.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Judge.dll defines following two struct types and exports the method
i4IcsJudgeStartGame. In csharp code there is a wrapper for this method.
Building succeeds, but running get an exception:
{System.Runtime.InteropServices.MarshalDirectiveException}
{"Can not marshal parameter #4: Invalid managed/unmanaged type combination
(this value type must be paired with Struct)." }
:Please help me, what's the problem in these code.
============================ in Judge.dll ========================
struct IcsGameRule
{
int fgHasTimeLmt;
unsigned short int u2RangZi;
unsigned short int u2TieMu;
};
struct IcsGameTime
{
unsigned char ucHour;
unsigned char ucMiniute;
unsigned char ucDumiaoLen;
unsigned char ucDumiaoCnt;
};
DllExport int i4IcsJudgeStartGame(unsigned int Judge,
int Type,
struct IcsGameRule Rule,
struct IcsGameTime Time);
===================== in csharp wrapper ==================================
[StructLayout(LayoutKind.Sequential)]
public struct GameRule
{
public int HasTimeLmt;
public ushort RangZi;
public ushort TieMu;
}
[StructLayout(LayoutKind.Sequential)]
public struct GameTime
{
public byte Hour;
public byte Miniute;
public byte DumiaoLen;
public byte DumiaoCnt;
}
[DllImport("judge.dll")]
private static extern int i4IcsJudgeStartGame(
[MarshalAs(UnmanagedType.U4)]uint judge,
[MarshalAs(UnmanagedType.I4)]GameType type, //GameType is enum
[MarshalAs(UnmanagedType.LPStruct)]GameRule rule,
[MarshalAs(UnmanagedType.LPStruct)]GameTime time);
|
|
|
|
|
Hi!
Try replacing [MarshalAs(UnmanagedType.LPStruct)] with ref .
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
It does work after the replacement.
Thank you!
|
|
|
|
|
Iam adding controls onto win form with this code:
Name, position, path and order, Iam reading from XML. That's OK.
name = lng.node.Current.GetAttribute("Namespace", "");
position = lng.node.Current.GetAttribute("Position", "");
path = GetModulePath(int.Parse(lng.node.Current.GetAttribute("BoundToID", "").ToString()));
order = lng.node.Current.GetAttribute("Order", "");
ass = Assembly.LoadFile(Application.StartupPath + "\\" + path);
t = ass.GetType(name);
o = Activator.CreateInstance(t);
uc = ( (UserControl)(o) );
I have module class that is a based class for module, and every control that has to behave like module have to be inherited from this class.
I have implemented collapse/expand option in module class and adding this button is handeled in module class, so when I inherit from module class, that control gets its own collapse/expand button.
I want to raise an event when I click on that collapse/expand button, but to catch the event in main form where Iam loading this modules, so I need a code how to create event handler with dymanically created events.
Normaly, I will do like so:
this.someModule.ClickedCollapseExpandButtonEvent += ClickedCollapseExpandButtonHandler(someModule_ClickedCollapseExpandButtonEvent);
And then
private void someModule_ClickedCollapseExpandButtonEvent(object sender, EventArgs e)
{
}
I hope you've understood.
|
|
|
|
|
You do it the same way. Just substitute this.someModule with the reference to the control.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for the reply, but I cant do it, becouse referenced control doesent have a definition for that event, even if I've created this event, it wont compile.
UC is type of UserControl (like you can see in code in my first post), and on execution, it gets a reference to loaded control, so I can't figure it out how to raise an event.
I can't explain well, but I hope youll understand.
|
|
|
|
|
Cast the reference to your class instead of UserControl.
---
b { font-weight: normal; }
|
|
|
|
|
Hi.
I did what you told me, but I have no clue what next to do to raise that event.
Can you provide some code sample?
Keep in mind that control is dynamically created so therefore, events are created dynamically as well.
Thank you.
-- modified at 7:58 Monday 13th November, 2006
|
|
|
|
|
Hi.
I have spent a lot of time thinking and Googling, and so far I found this » http://msdn2.microsoft.com/en-us/library/ms228976.aspx.
Code below is taken from this link, and when its executed, I get an error that is miHandler is null.
I cant figure it out why, and does this code surely do what I want?
I have CollapseHandler event and proper delegate and surely I hace CollapseHandlerVoid for running the code when event gets fired.
EventInfo evClick = t.GetEvent("CollapseHandler");
Type tDelegate = evClick.EventHandlerType;
MethodInfo miHandler = typeof(frmMain).GetMethod("CollapseHandlerVoid");
Delegate d = Delegate.CreateDelegate(tDelegate, miHandler);
MethodInfo AddHandler = evClick.GetAddMethod();
Object[] addHandlerArgs = { d };
AddHandler.Invoke((object)this, addHandlerArgs);
Help, please.
|
|
|
|
|
Solved...
((YuGit.DesktopModules.Module)uc).CollapseHandler += new YuGit.DesktopModules.Module.CollapsedEvent(frmMain_CollapseHandler);
|
|
|
|
|
Who can show me how to catch message in Yahoo Messenger by C#.
suppose that, when I send a message, then a image will be sent.
|
|
|
|
|
This is juat a hint that yahoo messenger uses InternetExplorer control for displaying messages... You need to get control of the underlaying IE if you need to trap yahoo messages...
|
|
|
|
|
hi
i am use VC# 2005 and i want to connect to sqlserver 2000 from client to server,when i want to add datasource to my app and enter server name to
specific textbox and click Test connection the following error shown me :
Login failed for user 'VAZIRI-B8765F7F\Guest'.
How to solve my problem ?
very thanks
|
|
|
|
|
Have you specified the correct user account and password for the connection?
---
b { font-weight: normal; }
|
|
|
|
|
Hi, i'm new in .net and most in C#.
Have a Service developed but i need to upgrade it.
The service must write a dinamic xml.
Why dinamic?, well because the service will read a configuration file from a external system like a cfg file or txt file or ini file.
Anyone did something like this ?
Exist something like standard process to do this ?
Any info will help me
thanks in adv
|
|
|
|
|
Well what's the problem then. Go ahead, create a dynamic file in you web application directory and use it.
|
|
|
|
|
hi
i want to pass my parameters to CrystalReports in VC# 2005,but how to do?
please give me an tested example for this topic.
very thanks
|
|
|
|
|
Something like this:
ReportDocument report = new ReportDocument();
report.Load(reportPath);
report.SetParameterValue(parameterName, parameterValue);
|
|
|
|
|
you can also check this link out, it might be useful for what you looking for
aPerfectTool
|
|
|
|
|
I m trying to run the exe on my roomate's laptop, but I'm getting the following error "the application failed to intiliaze properly !!!"
how can I run the app I wrote for my roomate in his laptop, he does not have c# compiler installed
aPerfectTool
|
|
|
|
|
Does he have the framework?
|
|
|
|
|
I dont thinki he does, he just bought new laptop with windows xp ,
aPerfectTool
|
|
|
|