|
Hi,
if your app is basically a C# program that calls a C++ dll, and that dll needs to
call back some method in the C# exe, then AFAIK you need to pass a delegate and use it
as a function pointer (or whatever it is called nowadays) in the C++ part.
Since the delegate type must be known to both the exe and the dll, it seems it must be
defined in the dll (again I dont know the details).
A more general approach would be to create an additional dll that holds the C# code
that is needed by both the C# main part and the C++ dll. Doing so allows the
C++ project (and the main C# part) to add a reference to the new C# dll.
|
|
|
|
|
How do I write the code to control a panel's scrollbar using the 9-way navigation button in pocket pc???
|
|
|
|
|
I have a web service listener. Once the exposed routine is called from outside it executes some code. The code tracks these responses in memory.
However, a subsequent call to my web service seems to reset the memory.
So for example,
1st call to my erb service
I log some data in memory
return success.
Next call to my web service
The stuff that i logged in memory, is gone.
Is this because by the second time around, the memory is fresh?
How would i get around this if i did not want to use writing to files instead?
|
|
|
|
|
Greetings,
I am a test automation engineer tasked to create automated regression tests for our product lines
Our application under test is a C# application that has 2 embedded IE controls. Due to limitations in our test automation tool(Mercury's Quick Test Pro 9.2), we are unable to extract any text from these controls. We need to extract this text in order to perform various verifications.
What I would like to do is create an external C# .DLL that our testing tool can utilize that will return the text from these embedded controls.
My total experience with C# consists of a 5-day training class, so I am very ineperienced with this. I honestly don't know where to begin with this.
Thanks in advance for any help!
Ed
|
|
|
|
|
hi.
please tell me how to access the control on mdi parent through control on child form. in C# 2.0 application.
|
|
|
|
|
|
I have a complex arraylist containing N types of objects.
public class cls1
{
property string p1;
property bool p2;
property string p3;
property string p4;
}
public class cls2
{
property int p1;
property string p2;
property bool p3;
property string p4;
}
Class cls3
{
property string p1;
property bool p2;
property int p3;
property string p4;
property string p5;
property string p6;
}
I want to bind the grid ROWS (NOT COLUMNS) with the arraylist containing rows of type cls1, cls2, cls3...clsN.
Like one row can contian data of object of cls1 .
Like other row can contian data of object of cls2 .
HARMINDER SINGH, R&D, WinShuttle Inc,
|
|
|
|
|
Hi
I would like write the function that does the same behavior of following C++ code. I tried to use the Process but I am sure I'm using it in worng way. Would you please guid me to the correct way to run the simple cmdLine?
This is the way I use the Process and it opens the winzip application and does nothing.
//progName = "c:\program files\winzip\winzip.exe"
System.Diagnostics.Process.Start(progName, cmdLine);
CString cmdLine;
cmdLine.Format("wzunzip -d -o \"%s\" \"%s\"",fileName,folder);// setting command line
System(cmdLine); //where cmdLine = "unzip "c:\a.zip" "c:\extractedfiles"
Thank you.
|
|
|
|
|
Specify arguments by setting Arguments property of ProcessStartInfo object and pass it to Process class object
|
|
|
|
|
Thank you for your answer Giorgi.
I tried this way but got error...
pStartInfo.CreateNoWindow = true;
pStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
pStartInfo.UseShellExecute = false; //and also tried with Yes
pStartInfo.Arguments = cmdLine;
pStartInfo.FileName = progName;
pStartInfo.RedirectStandardError = true;
System.Diagnostics.Process.Start(pStartInfo);
|
|
|
|
|
What is the actual value of cmdline that you passed?
|
|
|
|
|
The actual command line that I'm passing is:
wzunzip -d -o "c:\sample.zip" "c:\outputfolder"
in C++ I simple has to pass the string to system(cmdLine ) function,
void ExtractZip(CStirng fileName,CString folder)
{
CString cmdLine;
cmdLine.Format("wzunzip -d -o \"%s\" \"%s\"",fileName,folder);// setting command line
System(cmdLine);
}
|
|
|
|
|
Are all the arguments and parameters correct? What error are you getting? What happen if you run the program which you want to start from cmd with those arguments?
|
|
|
|
|
You are right, Giorgi..
My argument isn't correct.
I found my error and now is working great.
Thanks for your advises and help.
^_^
|
|
|
|
|
You are welcome, glad that I helped you
|
|
|
|
|
Hey,
anyone know the equivalent of VB's MOD, in C#?
Cant find it
|
|
|
|
|
it's the percent symbol:
int n = 10 % 3; n == 1
|
|
|
|
|
|
|
|
|
Daniel Grunwald wrote: Daniel Grunwald
Strangely, I remember trying something on that once and finding that it didn't work, so went back to the developerfusion hosted one. This would have been about a year ago.
Kevin
|
|
|
|
|
Send me a mail if something doesn't work. Note that our converter currently only accepts code that would be valid syntax as a file (whole compilation unit) - this means you can must post whole class definitions, code snippets won't be recognized correctly.
|
|
|
|
|
Daniel Grunwald wrote: Note that our converter currently only accepts code that would be valid syntax as a file (whole compilation unit)
Ah, that would be it then. In that case it would be more useful if it was like the developerfusion version.
Kevin
|
|
|
|
|
OK, I'll try to implement that.
But from a converter, I expect that it gets most things right. Here is a test case that our converter does right, but many others don't:
using System;
public class MyClass
{
string abc;
public string Abc { get { return abc; } }
static void M<T>(params T[] args) where T : IDisposable
{
Console.WriteLine("Hello!");
}
}
Difficulties:
1) realizing MyClass is not a valid identifier in VB
2) renaming abc to not conflict with Abc, since VB is case insensitive
3) not dropping comments
4) supporting generics - .NET 2.0 isn't new anymore in 2007
5) not messing up the ParamsArray parameter
6) noticing M<t>() is a private method because the C# default is private. In VB, it must read "Private Shared Sub" because the default visibility in VB is Public.
All of these at not uncommon in C# code (e.g. "Stop" might be a C# method name, but is VB keyword).
The Telerik converter is quite good (gets all except #2 and #6 right), our converter gets all right (because I created the example based on our unit tests), all others I tested failed miserably.
For SharpDevelop/NRefactory 3.0, I'm looking into making the converter aware of the code semantics - so that VB->C# can get a(1) converted to a[1] or a(1) depending on what a is. And make VB->C# fix up inconsistencies in the casing.
Last modified: 31mins after originally posted -- added difficulty 6
|
|
|
|