|
Our C++ to C# Converter utility will get you part of the way there (there will be some adjustments you'll have to make, but the conversion quality is pretty good for Managed C++ or C++/CLI).
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to C++/CLI Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
i have been looking at that one mate, i have a good part of it converted by doing it myself and using that software above, only problem is i do not knonw the difference between .CPP files and .h files. there is some of them in my project with the same name for example game.h and game.cpp how would i encorporate them into one c# class??
thanks and sorry for being niave, not a big user of c++
thanks again
|
|
|
|
|
'C++ to C# Converter' takes care of that. During the conversion, it automatically merges the header file with the same name into the conversion input (in C++, '#include' just inputs the file at the location of the #include before compilation).
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to C++/CLI Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
what happens if there is two header files, i can only select one at a time
thanks
|
|
|
|
|
C++ to C# Converter will process all header files.
You can also choose to embed all header files in the converted output, but I doubt that you'd want to do this.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to Ruby Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
Hi,
if your code is managed .NET code and builds to a working EXE or DLL file,
you should be able to use Reflector and convert it to source code in any of
the .NET languages; if successfull this would result in compilable code but will
lack any kind of comments your original may hold.
|
|
|
|
|
fellas i have been trying to covert it and cannot, i dont know what i am doinf wrong, i have tried refecltor and C++ to C#
if i would upload my orginal C++ program and the new C# with all the interfaces built without any code would somebody be kind enough to convert it as you guys know what you's are talking about and would have it done alot quicker
id be ever so appriceative
thanks fellas
PS could you let me know either way?
thanks
|
|
|
|
|
Sorry I do not intend on doing your work, and I don't expect any one else will either;
this forum is for helping people with a specific question or problem.
|
|
|
|
|
hello,
I would have a question about the C++ defined types to be available in .NET applications.
We have some implementation in C++, and we have been defining some classes that use templates and do some smart things. Now we have a need to be able to use those classes in C# for example, probably using an intermediate C++ CLI class-library.
The problem is how to make available those classes without to write for each class in native C++ an analog class in the C++ CLI module ? The CLI module will only include the native C++ code.
ex of what I'm looking to achieve:
C++, file "myclass.h"
class MyClass{};
class MyPipe
{
......void SendObject( MyClass& myClass );
}
C++ CLI
#include "myclass.h"
namespace BridgeClassLibrary {
....class PipeWrpper {
..........void SendObject( MyClass& myClass ){
...............MyPipe pyPipe( "super-pipe" );
...............pipe.SendObject( myClass );
..........}
....}
}
C#
using BridgeClassLibrary ;
namespace Logics.Test {
.....class PipeTester {
........static void Main( string[] args ) {
............MyClass myClass;
............PipeWrpper pipeWrpper;
............pipeWrpper.SendObject( myClass );
........}
.....}
}
modified on Friday, December 07, 2007 11:31:20 AM
|
|
|
|
|
In order for native C++ classes to be visible to a C# application, they have to be wrapped by C++/CLI. In C++/CLI assemblies, native C++ classes have private access. Thus, C# applications can not see them. Also, CLR is not aware of C++ Templates. However, they can be wrapped and used without any problems. Furthermore, with the help of Generics and Interfaces, you can facilitate the wrapping of your Template classes.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
ok, antoher idea
mm...
ho to import C++ classes into C# from a DLL written in C++.
If it helps the header and the .lib file will be available.
thanks
|
|
|
|
|
carabutnicolae1234 wrote: ho to import C++ classes into C# from a DLL written in C++.
If it helps the header and the .lib file will be available.
No, as George already told you, you can't do that. To use a native C++ library in managed code create a C++/CLI class library where you wrap the native C++ classes in managed classes. Then C# code can access them by using the managed classes.
|
|
|
|
|
|
Hi, I am coding a Flash Video .flv player. It seems the sound of swf/flv file can not be turned off if the author of that swf/flv file doesn't provide a built-in sound controller inside the file.
Is there anyway around this?
|
|
|
|
|
Hi all,
First of all I am not exactly sure whether I can post this problem in this forum. If its wrong I am sorry for that. I am delibrately need a solution to this problem.
I am trying to create an executable, but when the .pc file converting to .c file I am getting lots of warning message like
<quote>
warning: old-style declaration or incorrect type for: main
warning: implicit function declaration:
warning: no explicit type given
of these 3 lines.
Any idea why I am getting these lines?
Any configuration issues?
What exactly needs to be done to solve these warning messages?
I am trying to compile this is new environment.
Any kind of suggestion would be helpful.
Thanks in advance
|
|
|
|
|
can u send me the makefile.
|
|
|
|
|
I have pasted the code of my make file. Here I am getting the warning message when sampleora.pc file is converted to sampleora.c file.
<br />
# Executables built by this makefile<br />
PROC=$(ORACLE_HOME)/bin/proc<br />
all: sample<br />
<br />
# Oracle environment setup<br />
include $(ORACLE_HOME)/rdbms/lib/env_rdbms.mk<br />
<br />
# Debug & Development Compiler Flags are below<br />
CFLAGS=-g -DSOCKSELECT -DSUN_SRC_COMPAT -I$(ORACLE_HOME)/rdbms/demo <br />
<br />
# Final Production Compiler Flags are below<br />
CFLAGS=-O -DSOCKSELECT -DSUN_SRC_COMPAT -I$(ORACLE_HOME)/rdbms/demo <br />
<br />
# Link Editor Flags are below (shouldn't need to change anything here)<br />
LDFLAGS=-L$(LIBHOME) -L$(ORACLE_HOME)/rdbms/lib -lsocket -lnsl<br />
<br />
ECHO=$(ORACLE_HOME)/bin/echodo<br />
LLIBPSO=`cat $(ORACLE_HOME)/rdbms/lib/psoliblist`<br />
<br />
FC=f77<br />
COB=cob<br />
COBFLAGS=-C IBMCOMP -x<br />
COBGNTFLAGS=-C IBMCOMP -u<br />
CPLPL=CC<br />
<br />
LLAIO=<br />
<br />
# directory that contain oratypes.h and other oci demo program header files<br />
INCORASTUFF= -I$(ORACLE_HOME)/rdbms/demo -I$(ORACLE_HOME)/rdbms/public -I.<br />
INCLUDE= $(INCORASTUFF) -I<br />
<br />
#<br />
CONFIG = $(ORACLE_HOME)/rdbms/lib/config.o<br />
<br />
# module to be used for linking with non-deferred option<br />
NDFOPT= $(ORACLE_HOME)/rdbms/lib/kpundf.o<br />
<br />
# flag for linking with non-deferred option (default is deferred mode)<br />
NONDEFER=false<br />
<br />
# libraries for linking oci programs<br />
OCILDLIBS=-lclntsh # $(LIBCLIENT) $(DEVTTLIBS) $(LLIBCORE)<br />
<br />
<br />
# object for linking oci programs in Fortran<br />
OCIFOR=$(ORACLE_HOME)/rdbms/lib/ocifor.o<br />
<br />
# object for linking oci programs in Cobol<br />
OCICOB=$(ORACLE_HOME)/rdbms/lib/ocicob.o<br />
<br />
PSOLIBLIST=$(ORACLE_HOME)/rdbms/lib/psoliblist<br />
CLEANPSO=rm -f $(PSOLIBLIST); $(GENPSOLIB)<br />
PROFLAGS=sqlcheck=semantics userid=/ dbms=v6_char dbms=v7 DEFINE=UNIX DEFINE=SUN_SRC_COMPAT DEFINE=linux<br />
<br />
EXE=sample<br />
OBJS=sample.o sampleora.o sampletcp.o <br />
<br />
# Rule to compile any program (specify EXE= and OBJS= on command line)<br />
build: $(OBJS)<br />
$(ECHO) $(CC) $(LDFLAGS) -o $(EXE) $(OBJS) -L$(LIBHOME) -lclntsh <br />
<br />
# "Shorthand" Rule to compile all the sample program<br />
<br />
samples: $(SAMPLES) <br />
<br />
$(SAMPLES):<br />
$(MAKE) -f $(ORACLE_HOME)/proc/demo/proc.mk OBJS=$@.o EXE=$@ build <br />
<br />
# Suffix rules<br />
.SUFFIXES: .exe .o .c .pc<br />
<br />
.pc.c:<br />
$(PROC) $(PROFLAGS) iname=$*.pc <br />
<br />
.pc.o:<br />
$(PROC) $(PROFLAGS) iname=$*.pc<br />
$(CC) $(CFLAGS) $(SQLPUBLIC) -c $*.c<br />
<br />
.c.o:<br />
$(CC) $(CFLAGS) $(SQLPUBLIC) -c $*.c<br />
<br />
sample.o: sample.h<br />
<br />
sampleora.c: sampleora.pc<br />
$(PROC) iname=$*.pc $(PROFLAGS)<br />
<br />
icim: $(OBJS)<br />
$(CC) $(LDFLAGS) -o $(EXE) $(OBJS) -L$(LIBHOME) -lclntsh<br />
<br />
LIBDIR= $(ORACLE_HOME)/proc/lib<br />
DEMODIR= $(ORACLE_HOME)/proc/demo<br />
<br />
install_files:<br />
-rm -f $(DEMODIR)/proc.mk<br />
-ln $(LIBDIR)/proc.mk $(DEMODIR)/proc.mk<br />
<br />
# Rules to relink the proc executable<br />
install: clean proc<br />
-chmod 755 $(ORACLE_HOME)/bin/proc<br />
-mv proc $(ORACLE_HOME)/bin/proc<br />
-chmod 755 $(ORACLE_HOME)/bin/proc<br />
<br />
clean:<br />
-rm -f proc<br />
<br />
LIBPLSHACK= $(LLIBPLS)<br />
proc:<br />
@$(ECHO) $(CC) $(LDFLAGS) -o proc $(PROCOBJS) $(LLIBPROC20) \<br />
$(LIBCGEN) $(LIBSLAX) $(LIBOSDGEN) $(LIBPCORE) $(LLIBPLS) $(TTLIBS)<br />
<br />
<br />
|
|
|
|
|
Hello, everyone.
I'm hoping this is the right place to post my question. I've been looking around on the net for the last couple of hours and haven't found a solution to my problem. (I did learned some new stuff for use in the future). So this is my situation. I have a program that lets the user create a response test using a movie. When I tried to draw on the movie the activeX controller always pushed its way to the front. So I've created a separate form that floats on top of the main form to draw on. The program also has three threads running, the main thread, a timing thread, and a thread that updates the floating form.
My problem is when I try and send a message to the floating form I trip a NullReferenceException. I've checked both the callback and my class, and both look properly initialized. The floating form is also correctly intialized. I've tried everything I could find, but nothing helps. I've included the method and the callback declaration. The floating form is called 'TestViewer' and the 'HOTSPOT' class is one I've created.
Thanks everyone for your help
(Sorry my code is in C++, but I know most people us C# or VB when programming in .net, and a lot more people frequent this form than the managed C++ one. If needed I can translate it into C#. Feel free to give me an answer in C#. Over the years I've gotten pretty good a translating C# to C++. Thanks.)
delegate System::Void SetDrawActivePanelCallback(HOTSPOT^ hSpot);
private: System::Void SetTestViewDrawActivePanel(HOTSPOT^ hSpot)
{
if(this->TestViewer->InvokeRequired)
{
SetDrawActivePanelCallback^ cb = (gcnew SetDrawActivePanelCallback(this,
&Edit::SetTestViewDrawActivePanel));
try
{
this->Invoke(cb, hSpot);
} // End try
catch(System::NullReferenceException^ e)
{
String^ s = e->ToString();
::MessageBox::Show(s);
} // End catch
} // End if
else
{
System::Windows::Forms::Panel^ panel = hSpot->GetPanel();
this->TestViewer->DrawActivePanel(panel, this->hotspotVisible);
} // End else
} // End SetTestViewDrawActivelPanel
|
|
|
|
|
This may not be your problem but shouldn't:
Member 3848269 wrote: SetDrawActivePanelCallback^ cb = (gcnew SetDrawActivePanelCallback(this,
&Edit::SetTestViewDrawActivePanel));
be coded with a "+=" rather than a "="!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
In the following example 1 I added rows to the DataSet
And I did not have any problem. However when I tried to add rows to a DataSet with more than one dimension I get the following error message at row 1 “Object reference not set to an instance of an object.”. I am unable to add the word new after equal sign. Does anyone know how to solve this problem.
Example 1
DataRow dr = dsI.EVar.NewRow();
dr["nRecordID"] = x;
dsI.EVar.Rows.Add(dr);
Example 2
DataRow dr = dsMI[x][1].EVar.NewRow();
dr["nRecordID"] = x;
dsMI[x][1].EVar.Rows.Add(dr);
Thanks in advance,
Michael
|
|
|
|
|
Hello, everyone.
I'm hoping this is the right place to post my question. I've been looking around on the net for the last couple of hours and haven't found a solution to my problem. (I did learned some new stuff for use in the future). So this is my situation. I have a program that lets the user create a response test using a movie. When I tried to draw on the movie the activeX controller always pushed its way to the front. So I've created a seperate form that floats on top of the main form to draw on. The program also has three threads running, the main thread, a timing thread, and a thread that updates the floating form.
My problem is when I try and send a message to the floating form I trip a NullReferenceException. I've checked both the callback and my class, and both look properly initialized. The floating form is also correctly intialized. I've tried everything I could find, but nothing helps. I've included the method and the callback decleration. The floating form is called 'TestViewer' and the 'HOTSPOT' class is one I've created.
Thanks everyone for your help
delegate System::Void SetDrawActivePanelCallback(HOTSPOT^ hSpot);
private: System::Void SetTestViewDrawActivePanel(HOTSPOT^ hSpot)
{
if(this->TestViewer->InvokeRequired)
{
SetDrawActivePanelCallback^ cb = (gcnew SetDrawActivePanelCallback(this,
&Edit::SetTestViewDrawActivePanel));
try
{
this->Invoke(cb, hSpot);
} // End try
catch(System::NullReferenceException^ e)
{
String^ s = e->ToString();
::MessageBox::Show(s);
} // End catch
} // End if
else
{
System::Windows::Forms::Panel^ panel = hSpot->GetPanel();
this->TestViewer->DrawActivePanel(panel, this->hotspotVisible);
} // End else
} // End SetTestViewDrawActivelPanel
|
|
|
|
|
hi ,
i am trying to copy file in a new file and search a name in newfile , see the code below, but not able to find method, what could be the code in place of ???????.
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
FILE *in, *out;
int i;
char str[100];
clrscr();
in=fopen("B.txt","r+");
if(!in)
{
printf("can not open input file");
exit(0);
}
out=fopen("newB.txt","w");
if(!out)
{
printf("can not open output file");
exit(0);
}
while (!feof(in))
{
fgets(str,100,in);
//for(i=0;str[i]!=null;i++)
fputs(str,out);
fclose(out);
fclose(in);
}
|
|
|
|
|
Turbo C does not support C++/CLI, so you're in the wrong forum. Try the Visual C++ forum
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This is a Managed C++ Forum.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi ,
Can any body help me in using MFC Extension UI dll in .NET Winform
Kamal
|
|
|
|