|
Stripping the first two chars of the code doesn't work because YEN => YE, but the country is JAPAN, code JP, BTW the ISO 4217 code for YEN is JPY, no YEN.
You can use a HashTable, and fill it at start of your application, this way:
HashTable ht = new HashTable();
foreach (CultureInfo ci in CultureInfo.GetCultures( CultureTypes.AllCultures ) )
{
RegionInfo ri = new RegionInfo(ci.LCID);
ht[ri.ISOCurrencySymbol] = ri.CurrencySymbol;
}
Later you access the symbol this way:
string sym = (string) ht[isocode];
Eduardo Diaz
site | english blog | spanish blog
|
|
|
|
|
|
There is many examples about blocking socket server.
However, the unblock examples is too little.
Please give me some hints.
Thanks!
|
|
|
|
|
OK, I'm just trying to learn how to use panels. I have a panel "pnlWorkArea" and I have a user control "uctrlNewCostTracker".
I just want to write a button action that will make the user control show up in the panel (the button and the panel are both on frmMain).
This should be easy, right?
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Just add the user control to the panels ControlCollection using Panel.Controls.Add
|
|
|
|
|
I do this frequently.
UcInfo = new ucInfo(this);
UcInfo.Parent = pnl01;
UcInfo.ShowLookup = false;
pnl01.Height = UcInfo.Height + 8;
UcInfo.Dock = DockStyle.Fill;
pnl01.Dock = DockStyle.Top;
...
pnl01.Visible = true;
|
|
|
|
|
Hi
I have been asked to export data from a cvs file and enter it into MSSQL database table. This export needs to be performed using a webpage. So a person would visit the web page and select a cvs files from his local drive, press a button and export will start.
Now I have no idea how CVS works and how I can take some fields from a CVS file and put them into MSSQL table.
Can anyone guide me how I can achieve this
kind regrads
|
|
|
|
|
Do you mean CVS (Concurrent Versions System), or CSV (comma separated value)? I assume the later.
There is no official standard at all regarding the format of a csv file.
Here's briefly what I have found out:
Usually it's not comma separated at all, but semicolon separated. Each data line ends with a line break, but you can't read the data line by line, as the data may also contain line breaks. The first line may or may not be column headers, and there is nothing in the file that clearly tells if it does. If data contains semicolons, quotes or line breaks, it's surrounded by quotes. Quotes inside data is written as double quotes.
You will probably want to ask for an example file to examine.
If you have MS Excel, put text in some cells, containing quotes, semicolons and line breaks. Export it as a csv file, and you have a test file with all the tricky parts of the format. You might also notice that the format that Excel exports doesn't always contain the same number of columns on all the lines.
---
b { font-weight: normal; }
|
|
|
|
|
damnnnnn...I got my post wrong.
Ies, meant to say CSV and not CVS
|
|
|
|
|
I have an assembly that is in the GAC which is using Reflection code to call a second assembly located elsewhere.
This second assembly has various dependencies, and for various reasons I dont want to GAC it or any of its dependencies.
The problem I am having is that while I can load the second assembly fine (by providing the full path to the Assembly.LoadFile(...) function, when I Invoke one of its functions I get a exception indicating that one of the dependencies cannot be found.
Is there anyway I can solves this problem without adding the second assemblies and its dependencies to the GAC??
I think the key here is the intellisense comment on the Assembly.LoadFile(...) function :
"..loading the assembly into the domain of the caller..."
Considering that the reflection code is called from an assembly in the GAC, does this mean that a virtual copy of the loaded assembly is placed into the GAC directories behind the calling assembly
|
|
|
|
|
Reading the documentation is always wonderful.
I would recommend rereading the MSDN entry on the Assembly object. From the docs:
Do not use LoadFile to load assemblies that you want to execute. LoadFile does not load files into the LoadFrom context, and does not resolve dependencies using the load path, as the LoadFrom method does.
LoadFile is strictly used to inspect an assembly on a file system. This is handy when you want to "look" but not actually run anything in an assembly. It does not load dependancies or do any other checking and hence is unreliable for execution.
|
|
|
|
|
1)how can i copy all element of 1 dataset to another dataset
2)i have an datagride in my form and it's a virtual dataset , how can i update it
|
|
|
|
|
Hello,
could anybody help me, please?
How do I do the P/Invoke of the following function (from TTNCom.lib of TomTom SDK)?
static INT GetSdkVersionInfoV01(TNavVersionInfoV01& aVersionInfo);<br />
<br />
struct TNavVersionInfoV01<br />
{<br />
char iVersion[16];<br />
INT iBuildNumber;<br />
};
I've tried:
[DllImport("TTNCom.dll", EntryPoint = "?GetNavigatorVersionInfoV01@CTomTomNavigatorCom@@SGHAAUTNavVersionInfoV01@1@@Z")]<br />
extern static int GetNavigatorVersionInfoV01(ref TNavVersionInfoV01 aVersionInfo);<br />
<br />
public struct TNavVersionInfoV01 <br />
{<br />
char[] iVersion;<br />
int iBuildNumber;<br />
}
but when calling it like:
TNavVersionInfoV01 nv = new TNavVersionInfoV01();<br />
<br />
int ShowTT = GetNavigatorVersionInfoV01(ref nv);
I get System.NotSupportedException.
There must be some problem with marshalling of types ...
Thanks anyway,
Honic
|
|
|
|
|
Hi!
Besides the fact that I don't know if your EntryPoint is correct (does it work if you leave out the EntryPoint parameter altogether?), you'll have to specify the size of iVersion for marshalling.
Right now you're just saying it's an array of char (without any size given), but the original declaration says it's a char[6] .
Try this struct declaration:
public struct TNavVersionInfoV01
{
[MarshalAs( UnmanagedType.ByValArray, SizeConst=6 )]
char[] iVersion;
int iBuildNumber;
} Regards,
mav
|
|
|
|
|
Hi,
the EntryPoint is correct, there is no problem. But I forgot to mention that it should work under Compact Framework and I'm affraid MarshalAs is not supported there.
Regards.
|
|
|
|
|
I have a right text box and i want to be able to insert a table and bullets into it. How ever i need to invoke the insert table dialog. Can any one please help me? And also ideas on how to invoke the bullets too.
thanks.
Nana
|
|
|
|
|
We have a voice xml interpreter that uses Xerces parser. The interpreter is developed in pure C++ using Visual C++. We wanted to replace the xerces parser with MSXML parser. We are also planning to recompile the vxml interpreter in the Dot Net platform. I have a couple of questions in this regard.
Question 1: If I choose the latest Dot Net platform that is "Visual Studio Dot Net 2003", what version of msxml parser does it support. What additional measures should I keep in mind when I replace xerces parser with msxml parser and recompile the whole vxml interpreter in the .Net platform?
Note that we dont want to change our interpreter code while shipping it in the Dot Net platform. Isthat possible?
Question 2: What will be the main effort area for replacing the xerces parser with the msxml parser.
Currently we are using SAX techinique, assume that we will also use SAX technique for the msxml parser.
S. Roy
|
|
|
|
|
This should probably have gone in the C++/CLI forum...but I'll answer it here.
Is there a reason that you want to use the MSXML parser? If you're compiling for .NET, then you may want to switch the parser to using the .NET Framework's System.Xml namespace. The System.Xml.XmlNodeReader or XmlTextReader objects will give you a SAX interface to the Xml that you've got. Or you could try the DOM interface with the XmlDocument object.
And no, your interpreter code doesn't need to be changed. You'll want to investigate Mixed Mode assemblies. This will enable you to run part of your code as MSIL on the .NET runtime and part of it in unmanaged/native mode.
The hardest part is just going to be getting used to the .NET platform. And maybe the funky syntax for the MC++ code.
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
Hello,
i'm using SendMessage winapi function in my program like this:
<br />
[DllImport("user32.dll", SetLastError=true, EntryPoint="SendMessage", CharSet=CharSet.Auto)]<br />
public static extern IntPtr SendMessage(<br />
IntPtr hWnd, <br />
[MarshalAs(UnmanagedType.U4)] int Msg, <br />
long wParam, <br />
int lParam);<br />
So i'm executing it and i want to use the returned value. But it seems that the returned value is a pointer. How can i get the value?
The code is like this:
<br />
IntPtr hWnd = FindWindow("Winamp v1.x", null);<br />
IntPtr lResult = SendMessage(hWnd, WM_WA_IPC, 0, IPC_GETEQDATA);<br />
-- modified at 9:38 Thursday 6th October, 2005
|
|
|
|
|
Hmm, may be the problem isn't in the returned type. But when i try this code in c++ it is working and the return value is correct, but in .NET i'm always receiving 20496
|
|
|
|
|
I found my problem. It is in the SendMessage declaration. The parameters should be IntPtr instead long and int:
<br />
[DllImport("user32.dll", SetLastError=true, EntryPoint="SendMessage", CharSet = CharSet.Auto)]<br />
public static extern IntPtr SendMessage(<br />
IntPtr hWnd, <br />
[MarshalAs(UnmanagedType.U4)] int Msg,<br />
IntPtr wParam,<br />
IntPtr lParam);<br />
|
|
|
|
|
Small correction:
You _can_ use int.
The only thing that was causing troubles was the long declaration, since longs in .NET are 8 byte and not 4 like WPARAM.
Oh, and the [MarshalAs...] declaration is superfluous, btw.
Regards,
mav
|
|
|
|
|
My application runs as a tray application. And I want it to be able to capture the play/pause, next and previous buttons on my Microsoft Natural Keyboard. Anybody have a suggestion on how to do this??
|
|
|
|
|
Hi guys
ArrayList objArrayList=new ArrayList();
objArrayList.Add("a");
we are adding values through Add property but i want to add value same as array so plz tell me how it is possible?
int[] onjAr=new int[]{1,2,3,4,5,6,7,8,9};
can i add value in this format e.g- {1,2,3,4,5,6,7,8,9}
|
|
|
|
|
The following should work:
ArrayList objArrayList = new ArrayList();
objArrayList.AddRange(new int[]{1,2,3,4,5,6,7,8,9});
www.troschuetz.de
|
|
|
|
|