|
should i add a using <dllname.dll> ?
and for functions in a class do i need to call Class::function()?
rather have something you don't need, than need something you don't have
|
|
|
|
|
donsolms wrote: should i add a using ?
yes
donsolms wrote: for functions in a class do i need to call Class::function()?
no
calling any CLR compliant language obeys the rules of the calling language, hence
in C# you need a using statement, and call as class.method(args) or object.method(args).
|
|
|
|
|
i can't get the using to work. i have the c++ dll in a namespace named touchlib and then a class named Touchable.
<br />
using touchlib;<br />
doesn't work, i have added a reference to the dll. a i missing something, maybe in the compiling of the dll? how can i be sure that the dll is managed c++? what type of vc++ project is managed c++?
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hi,
I dont remember the details for C++, but you did build the C++ dll, didnt you ?
so you know it is/isnt managed code.
if you were able to add a reference to it in your C# app, it must be managed code.
now Intellisense should show the available classes (C# and managed C++).
|
|
|
|
|
thanks a lot, it is working 100% now.
i might have referenced an older version of the dll somehow, and after a simple clean solution for the c++ dll and c# project made it work.
thanks again
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hi.
I want the algorithm for solving 3Evaluation-3Passive :
ax+by+cz=d
ex+fy+gz=h
kx+ly+mz=n
I can solve this in math, but I confused of using this way as an algorithm
Best wishes
|
|
|
|
|
So what makes you confused? At what stage? Also there is a special forum for math and algorithms
|
|
|
|
|
I'm not familiar with 3Evaluation or 3Passive. However if you can solve it in math it should not be too hard to solve it in C#. Your algorithms that use complex functions would use methods in the Math library within the framework. For example if part of the code required getting a cosine of the delta between x prime and x n, then you would write..
xPrime = someValue;
xN = newValue;
skewedResult = Math.COS(xPrime, xN);
The only thing you'd have a pain with is if you have to take a differential of an equation.
|
|
|
|
|
How can I build a windows form which contains a table?
|
|
|
|
|
What table????????
SG
|
|
|
|
|
There's a toolbox in the designer. You should be able to click and drag one of many kinds of tables from there.
|
|
|
|
|
I have an application where the user can enter a string to pass to the com port. A common string for this program is "W\r" with \r being carriage return.
When the program passes the string through the accessor, it shows up through the debugger as scaleStation.SendString = @"W\r". I don't want the literal value "W\r", I want "W" with a carriage return.
I ended up using the following for the solution, but was wondering if there is a better way to do this? I am worried the user may find another escape string that I may not have coded for.
string ss = scaleStation.SendString;
SendStr(ss.Replace(@"\r","\r"));
Thanks for your ideas!
Hogan
|
|
|
|
|
The debugger is indeed showing it right! It's just showing the string representation of carriage return. The @ is to make sure that the '\' is not taken as an escape sequence. In essence, the Replace you do does not accomplish anything.
SG
|
|
|
|
|
Maybe I didn't explain myself correctly, but the replace I put in the code did fix the problem.
I'll try again.
If I call the command SendStr("W\r"), it passes a Capital W and carriage Return to the com port. This works as desired as the device attached is expecting this string.
If I set a variable through a text box, I get the value @"W\r" passed literally to the device with no carriage return. So the command looks like SendStr(stringVariable).
Sample Application code: http://www.snorkie.com/codesamples/stringsample.txt
Set your breakpoint at line 105. Press the button and look at the value of the two variables s and s2 by putting your mouse over them or using the watch. You will see that they are different...
s = "W\r"
s2 = @"W\r"
Using the value from s2 won't pass the carriage return I need for my device. Converting s2 using the code s2.Replace(@"\r","\r") does give me the value I need.
So again, I have a solution, but I think there has to be a better one. Does anybody see a better way to do this?
Thanks
Hogan
|
|
|
|
|
There are 14 different escape codes[^].
You can use the RegEx.Replace method with a pattern like "\\([\\0bfnrtv])", and a delegate to determine the replacement character, to replace them.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello developers.
I need a help with clickonce deployment.
I my app it's has a *.mdf file, when I install my app the *.mdf goes to ...\Local Settings\Apps\2.0\... folder
But the app's folder has a complex name, as app...ex3ynnnnnadiGGGfzzzsds
Can I customize this name?
|
|
|
|
|
Nope, I guess not. But in any case, you can dynamically get the folder name at runtime using Application.StartupPath. So why bother about the long folder name?
SG
|
|
|
|
|
That actually doesn't work with a ClickOnce deployment. Content files, like an MDF file go into a very different folder from your executable. You can use the Deployment namespace to find the path to that folder (I forget exactly how right now), or I THINK you might also be able to cheat and use |DataDirectory| in the connection string (I haven't tried this yet!).
|
|
|
|
|
The problem was solved
Tks for all
When I attached the mdf file, I needed attach it as Data File
When I changed this option, everything works all right
|
|
|
|
|
The only thing you need to do is have a server that will how the deployment. So if you were using a file share \\myServer\InstallAdministrator then just do the following:
1) Open your solution
2) Right click your project you want deployed
3) Choose Publish from the popup menu.
4) When asked give it the server location
You will get a web page that describes what is published and that is the URL you publish to your users. Voila, they click that url, they click Install, and in seconds they are running the application. From that aspect...who cares how things are named on the server since neither you nor the user will actually see the deployment folder day-to-day.
|
|
|
|
|
I have been working on something in a project for the past few days, and I have been getting a little frustrated, and I have to decided to start from scratch. I am looking for some input on what I want to do, so any suggestions are certainly welcome.
I have a form which unzips data files, then calls an Import method from a class in a seperate project. When importing it uses SQLBulkCopy to copy all data in these files to a sql database. There is a large amount of data, so I need to keep the user informed of the progress during importation. So I want to display on the Form the data file name, count, and index while also displaying on a progress bar the percentage of data copied of the total amount from that file. This information will be updated on said form everytime a Batchsize is completed.
Input on how you would tackle this would be great.
|
|
|
|
|
Well you definitely need to use multithreading to make you GUI responsive during the time-consuming unzipping operation. You need to use raise events from your worker thread to notify the GUI of the progress. There needs to be proper marshalling between the threads.
Maybe this link:
http://msdn2.microsoft.com/en-us/library/ms998490.aspx[^]
will give you some ideas.. Especially the section "Using Tasks to Handle Interaction Between the UI Thread and Other Threads" will be relevant to you..
Hope this helps,
Bijesh
|
|
|
|
|
I would use a third party tool to take care of the SQL stuff. I use Red-Gate tools and have never had a problem with them. (No, I don't work for them) Red-Gate SQL Packager will package objects and data with an executable and supports command line.
Just my thoughts.
Hogan
|
|
|
|
|
I've been asked to help solve a performance issue if I can. A person requires an application which can distribute, virtually simultaneously, to as many as tens of thousands of client applications, a small amount of data. The data will usually be a single integer, but it is critical that all of the client applications receive the data with the very least possible delay, and, if possible, at virtually the exact same time. It cannot be known beforehand exactly when the server application will be able to determine and broadcast the data. The client applications must link to the server application; wait; and all be able to react to the data broadcast immediately.
Has anyone here written such a set of applications, or is anyone familiar with what kind of architecture or approach is necessary to achieve this kind of performance?
All reasonable approaches are legitimate candidates for solution.
TIA
m
|
|
|
|
|
I had to deal with a situation like this, but the data was coming from PLC's and we had an OPC server running on the server, the software running on the client side using an OPC client would subscribe to the item and receive data. All the clients would simultaneously get the data, the updates were pretty fast also(considering each client subscribed to 100's of items). You could probably try to google about OPC and find out what kind of architecture they are using to do it.
|
|
|
|