|
In my app, there are labels and rich text boxes on a report. When I select Japanese, Korean, or Chinese locales, the text in the labels is displayed as Asian characters. But, the rich text box contains question marks (I'm running XP, SP2, US). Is there a way to display Asian characters in a rich text box on this operating system, or do I need a Chinese operating system, a Japanese operating system, and a Korean operating system to view the Asian characters in a Rich Text Box?
This code works for languages like German, Italian, French.
m_rtfCircuitDesc.Rtf = @"{\rtf1\ansi \nowwrap " + strDesc + "}";
Thanks in advance.
-- modified at 15:09 Friday 27th October, 2006
|
|
|
|
|
Does anyone see what's wrong with the following code?
I followed some earlier advice and simplified things greatly. I no longer get exceptions thrown but my secondStrucure has no no calculated data in it when my bigStructureObj is returned. In my testApp, I populate the bigStructureObj with all the data the VB6 program sends to the dll (This problem is not occuring in VB6.)
I have the following dll code / c# code. I am definitely new to this and am guessing I'm just not getting the reading I've been doing.
#define theSIZE 145
typedef struct {
float smooth[theSIZE];
float first_der[theSIZE];
float sec_der[theSIZE];
float integral[theSIZE];
} thirdStructure;
typedef struct {
long num_v_points;
float v_time[theSIZE];
thirdStructure results;
} secondStrucure;
typedef struct
{
long window;
long num_points;
float xdata[theSIZE];
float ydata[theSIZE];
float v_time;
secondStrucure rdata;
float integral_const;
float integral_time;
float desired_x; .
} bigStructureObj;
//******************************************************************************
[StructLayout(LayoutKind.Sequential)]
internal struct thirdStructure
{
[MarshalAs(UnmanagedType.SafeArray)]
internal float[] fSmooth;
[MarshalAs(UnmanagedType.SafeArray)]
internal float[] fFirstDer;
[MarshalAs(UnmanagedType.SafeArray)]
internal float[] fSecondDer;
[MarshalAs(UnmanagedType.SafeArray)]
internal float[] fIntegral;
public thirdStructure(int c)
{
this.fSmooth = new float[c];
this.fFirstDer = new float[c];
this.fSecondDer = new float[c];
this.fIntegral = new float[c];
}
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal struct secondStrucure
{
[MarshalAs(UnmanagedType.I4)]
internal int NumVirtualPoints;
[MarshalAs(UnmanagedType.SafeArray)]
internal float[] fv_time;
[MarshalAs(UnmanagedType.Struct)]
internal thirdStructure vb_Results;
public secondStrucure(int b)
{
this.NumVirtualPoints = 0;
this.fv_time = new float[b];
this.vb_Results = new thirdStructure(b);
}
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
internal struct bigStructureObj
{
[MarshalAs(UnmanagedType.I8)]
internal long iWindowSize;
[MarshalAs(UnmanagedType.I8)]
internal long iNumRealPoints;
[MarshalAs(UnmanagedType.SafeArray)]
internal float[] fRealTimePoints;
[MarshalAs(UnmanagedType.SafeArray)]
internal float[] fRealPoints;
[MarshalAs(UnmanagedType.R4)]
internal float fVirtualTimeWidth;
[MarshalAs(UnmanagedType.Struct)]
internal vb_LOESS_II_RESULTS vb_well_data;
[MarshalAs(UnmanagedType.R4)]
internal float fIntegralConst;
[MarshalAs(UnmanagedType.R4)]
internal float fIntegralTime;
[MarshalAs(UnmanagedType.R4)]
internal float fDesired_x;
public bigStructureObj(int a)
{
this.iWindowSize = 0;
this.iNumRealPoints = 0;
this.fRealTimePoints = new float[a];
this.fRealPoints = new float[a];
this.fVirtualTimeWidth = 0;
this.vb_well_data = new secondStrucure(a);
this.fIntegralConst = 0;
this.fIntegralTime = 0;
this.fDesired_x = 0;
}
}
|
|
|
|
|
|
What exactly you want to do?
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
|
What code have you written so far? No-one will do this for you. Show your efforts so far and when you get stuck people will offer help.
Kevin
|
|
|
|
|
|
|
Rahithi wrote: if somebody help me to code this, it will be better for me now.
Of course it would be better for you now if someone just wrote the code for you.
In the long run, however, it's better for you if you learn two things from this:
1. Don't expect other people to do your homework.
2. If you have no idea on how to do the assignment, an hour before it's due is not a good time to start working on it.
Of course we are willing to help you with any problem you have while doing your assignment. This of course requires that you actually made an attempt, so that you know specifically what it is that you have problems with.
---
b { font-weight: normal; }
|
|
|
|
|
Wow, that's ballsy for sure. Please do my homework because I waited until the last minute.
|
|
|
|
|
|
|
You don't know anything about C#, but you have to turn in a web site navigation assignment in 4 hours?? Good Luck!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You have everything you need in your description above. Break it down into steps. The entire project should take under 1/2 hour even if new to C#
|
|
|
|
|
First step is File -> New -> Project , or Ctrl+Shift+N for you advanced users.
|
|
|
|
|
|
I can call a JScript function from a c# App doing as follows:
SHDocVw.InternetExplorer oIe;
oIe = new SHDocVw.InternetExplorerClass();
Object strUrl = @"C:\blank.htm";
Object o=null;
oIe.Navigate2(ref strUrl ,ref o,ref o,ref o,ref o);
mshtml.HTMLDocument doc = (mshtml.HTMLDocument) oIe.Document;
doc.parentWindow.execScript("alert('Messge from JScript')", "JScript");
MessageBox.Show("Done");
oIe.Quit();
and what happens is that untill the JScrip dialog is closed my app is blocked.
How can i mak the call async? I tryed with BeginInvoke but got errors.
Regards
|
|
|
|
|
sterenzi wrote: but got errors.
What errors? We can't see them from here.
led mike
|
|
|
|
|
I get what follows:
An unhandled exception of type 'System.InvalidCastException' occurred in mscorlib.dll
You can't get with the code i provided, I'll put the sample code for errors in a few mins.
|
|
|
|
|
OK, if you try the following code you can get the error,notice that I'm not sure this is the best way to follow...
delegate Object execAsyncJScriptDelegate(string param, string lang);
private void button2_Click(object sender, System.EventArgs e)
{
SHDocVw.InternetExplorer oIe;
oIe = new SHDocVw.InternetExplorerClass();
Object strUrl = @"C:\blank.htm";
Object o=null;
oIe.Navigate2(ref strUrl ,ref o,ref o,ref o,ref o);
mshtml.HTMLDocument doc = (mshtml.HTMLDocument) oIe.Document;
try
{
execAsyncJScriptDelegate jFunc = new execAsyncJScriptDelegate(doc.parentWindow.execScript);
IAsyncResult ar = jFunc.BeginInvoke("alert('Message from JScript')", "JScript", null, null);
MessageBox.Show("Done");
oIe.Quit();
while (!ar.IsCompleted)
{
Application.DoEvents();
}
jFunc.EndInvoke(ar);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
|
|
|
|
|
Well in .NET 2.0 I emulated your attempt using WebBrowser.Document.InvokeScript(). It did not throw an exception but the script did not execute and the IAsyncResult is completed upon return. So it appears that async invocation of scripts might not be supported.
led mike
|
|
|
|
|
I have a windows application from which I "call" a method from a web service. The method returns an array of some objects (objects are from a class I created and they are located on the service side.)Objects have their public methods.
Now, on the client side (the win application), I accept that array, but I can't access the methods of the object... Why?
The code is something like this (the client side):
Service srvce = new Service();
Service.MyClass[] arrayObjects = new Service.MyClass[1000];
arrayObjects = srvce.GetArrayOfObjects(); //this returns the array I was talking about
//since that class has a public GetMyProperty() method, I should call that method from tha client side, right?
int myProperty = arrayObjects[0].GetMyProperty();
//but that doesn't work, I can't call any of the methods... IntelliSense gives me nothing after arrayObjects[0]
//it doesn't work when I do the conversion
int property = (arrayObjects[0] as Service.MyClass).GetProperty();
So, I can't call the methods, it's like they are private - and they're not, they're public, I just can't see them from client, and why is that?
I'm stuck... Help!
|
|
|
|
|
Are the objects in the array marked as [Serializable]? When you debug, can you see the objects in the array?
|
|
|
|
|
Well, actually, they're not marked as [Serializable]. During debugging, I can see there are 5 array members, and the debugger returns the correct type (MyWebService.MyClass, for example), but that's it, I can't access them, I can't do anything with them. Now, that's probably because that array of objects are created on the service side, and they sre returned to the client. Maybe it would help if I instantiated the array on the client, and send that array to the service to be "filled"? But the problem is the size of the array - I can't predict that, and it would be silly to set it to 100 and it's count is only 3.... Maybe I can use ArrayList instead? The problem is that I'm new to web services (although not to win forms programming), so I don't know much about serialization... So any tips will be appreciated...
|
|
|
|
|
I want to create one bluetooth application which can send commands to a robot which is having a bluetooth receiver.I am clear till the application that sends the bt signals to robot but from receiver side what should I do?Can Any one tel me.How can I do programming there in C#.
nishu
|
|
|
|