|
Hi,
I'm working on a ruler control, but it won't be ready until about 2 months from now (because there's more pressing things at hand right now).
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
:-DI want use DTC to manager distribute transaction directly .I don't like COM+,because of i only need transaction manager,and that i'm worry about overhead.
So,i wanna program DTC as VC++(use olbdb or dblib) in dotnet.
I import the DTC interface through PInvoke,but i can't use ado.net/oledb.net enlist in DTC transaction,want me to wrap native DAO?
good good study,day day up
|
|
|
|
|
There are a bunch of Attributes that mimic the functionality of COM+ ( dtc, opbject pooling, queued components, J.I.T.A., etc. ).
I think they're in System.EnterpriseServices. Hope this helps....
|
|
|
|
|
Thank you!But I try to find something in System.EnterpriseServices,draw a blank..........~~~>_<~~~~~
Who can help me?
good good study,day day up :<)
|
|
|
|
|
Hi friends
I want to pass a SAFEARRAY of BSTR from a unmanaged code to a managed assembly. My constraint is I can accept just an IntPtr in the managed code. I tried passing SAFEARRAY*, but could not convert it to Array or string[] in the managed code. Can anybody suggest how to achieve it?
vikram
|
|
|
|
|
Use the MarshalAs(UnmanagedType.SafeArray) attribute or MarshalAs(UnmanagedType.Bstr) . If necessary, combine it with the [in] and [out] attributes.
|
|
|
|
|
I have been trying to use unique numbers, but this does not seem to work. The data wizard will always leave them out, and I cannot find a value similar to unique number. Anyway, so I have thought, maybe I should make my own. So I want to know the best way to do this.
Do I, count the number of records, and add one (bearing in mind, data will never be deleted), or do I search through all records, and find the largest number in the column, and add 1 to this? If so for the last one, how would I do that? Would a while loop or a for loop be better? Lastly, in SQL, the column is set to uniqueNumber. Should I use bigInt?
|
|
|
|
|
Seems a bit odd replying to myself, but I found a solution, so this is for anyone who ever has a similar thing. This is if you want to create your own unique number. The code is:
int test1 = 0;
int test2 = 0;
for (int i = 0; i <= yourDataSet.yourTableName.Count - 1; i++)
{test1 = yourDataSet.yourTableName[i].theID;
if (test2 <= test1)
{test2 = test1 + 1;
}}
Sorry about how I compressed this. It counts the number the number of rows (in the format 1, 2, 3, etc, which is why you must - 1, else you will get an error). The last part just compares the numbers.
|
|
|
|
|
Normally you would just set the column as read only and let SQL autoincrement it, or create a GUID.
<a TITLE="See my user info" href=http:
|
|
|
|
|
You could also setup in the DataSet that the column is auto-increment. So whenever you insert a new record, it will create a new ID for you.
There is a problem with this though, as the ID always starts at 1 (or if populated from the Db, the last ID). So if your DB has 5 records in it with IDs of 1 though 5. And you retrieve ID 3 into your DataSet and add a new record, the ID will be 4. Now if you try to save it back to the database, it will error.
Hope this helps
|
|
|
|
|
Hi all,
I tried trapping the Up, Down, Left and Right arrow keys in KeyDown, KeyPress and KeyUp. These methods are never called when these keys are pressed.
Does anynone know of a way to trap these keys in the datagrid? I thought I could use the CurrentCellChanged method, but I need to apply something before the cell moves.
Thanks,
Chris
|
|
|
|
|
If you want to process the keys yourself you can derive you own grid from DataGrid and override the ProcessCmdKey method such as:
public class MyGrid : DataGrid<br />
{<br />
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)<br />
{<br />
return true;<br />
}<br />
}
Rocky Moore <><
|
|
|
|
|
How do I know the Width & Height of physical screen in millimeters ? if I don't use DllImport("gdi32.dll") & GetDeviceCaps(hDC.ToInt32(),HORZSIZE) , because it must know hDC first!
thank you very much !
|
|
|
|
|
Maybe SystemInformation is what you need.
Mazy
No sig. available now.
|
|
|
|
|
thank you !! but How do I know the window's millimeters or inches ? because I want to creat a form in any monitor device get the same size.
( like C++ GetDeviceCaps(hDC, HORZSIZE) )
|
|
|
|
|
|
I have one 'exe' and one 'dll' and I want to provide debug swtiches via config files.
Do I need two config files? (ApplicationName.exe.config and ApplicationName.dll.config) or One is enough?
Don't and drive.
|
|
|
|
|
You will need one for the primary driver of the process. That would be the app.exe.config
|
|
|
|
|
I already did that. And I kept the config file (applicationname.exe.config) in Debug\bin directory along with the EXE and DLL's.
< ? xml version="1.0" encoding="utf-8" ? > <br />
< configuration ><br />
< system.diagnostics ><br />
< switches ><br />
< add name="MySwitch" value="1" / ><br />
< / switches ><br />
< / system.diagnostics ><br />
< / configuration >
Ignore the spaces.
And declared the switch in both EXE and DLL's in their classes.
private static BooleanSwitch DebugSwitch = new BooleanSwitch("MySwitch", "Debug Switch for Trace and Debug.");
Eventhough I enabled the switch in the config, switch is always disabled.
Did I miss any other settings?
Don't and drive.
|
|
|
|
|
Two things to try. First of all in your solution, do you have the exe set as startup or DLL as startup and then asking the DLL to run the exe? If the latter then you need to switch to the former. I think.
Also what is the syntax you are using to get the value in the config file? Can you put a break point and see what is coming through? Maybe its not even picking up your config. Since you said you put the code in both the DLL and the exe, and that it is always coming disabled, it just might mean you are not picking up the value from the config file at all. Try looping through all values in the config file. If you get something then it means that the config file is being accessed, just not your switch. Try to get it to work with the exe and then move to the DLL.
OK hang on. Something very strange happened. I just upgraded to VS .Net 2003. I was looking into my sample code to see if there was anything more I had to tell you. I ran my sample and somehow my config file vanished. It was there and now its not. Go figure. Let me reset it and get back to you. Damn!!!!
|
|
|
|
|
Ranjan Banerji wrote:
Two things to try. First of all in your solution, do you have the exe set as startup or DLL as startup and then asking the DLL to run the exe? If the latter then you need to switch to the former. I think.
Exe is startup and calls the DLL.
Ranjan Banerji wrote:
Also what is the syntax you are using to get the value in the config file? Can you put a break point and see what is coming through?
private static BooleanSwitch DebugSwitch = new BooleanSwitch("MySwitch", "Debug Switch for Trace and Debug.");
if(DebugSwitch.Enabled) <br />
{<br />
...<br />
}
Ranjan Banerji wrote:
it just might mean you are not picking up the value from the config file at all. Try looping through all values in the config file.
I think so. It's just only switch I am testing.
Do I have to keep this config file in the Build Action for the project?
I am running VS.NET 2002.
Don't and drive.
|
|
|
|
|
Does anyone know of a decent UML tool designed to work well with C#/.NET? I've been looking for one for a while, with no real luck.
|
|
|
|
|
I've been looking for a good one for some time. I found one that looks good, but it requires Windows 2000 or above and I have only Windows 98. (Sorry, I don't even remember its name.)
Right now, I use ProxyDesigner[^].
Let me know if you find a good one.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I think, that you can use Microsoft Visio. There is plug-in to Vs.Net. But you need to download Visio SP (AFAIK).
i'm only pointer to myself
|
|
|
|
|
You might want to take a look at Enterprise Architect from SparxSystems.
A co-worker of mine who is a UML/design guru and now the leading C# expert that I know, swears this tool is the best he's used. We have before always used Rational Rose...he claims this does everything Rational Rose does only better and for only about $150 (instead of a few thousand like Rose).
It does reverse engineer and produce skeleton code for C# among other languages. I have been so moved by his rants over the last 6 months or so, I've actually finall purchased it myelf, just last weekend. I haven't had time to play with it myself, yet though.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|