Click here to Skip to main content
       

C / C++ / MFC

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: problem deploying applicationmvpRichard MacCutchan26 Sep '12 - 21:29 
I'm sorry but we cannot begin to guess what is happening in your program. You need to find out what is happening in your drawing function and whether it is reading the file and processing its content correctly.
One of these days I'm going to think of a really clever signature.

Questionexceptions always SIGABRT in linux shared objectmemberMichaelRoop25 Sep '12 - 1:28 
I have built a unit tester in C++. Compiles and runs under VS and linux (Ubuntu 10). (I know, there are others out there. Spare time project of mine over the years)
 
I just finished the port to Linux. However, if I throw an exception anywhere, within the shared object that contains the test case it will signal SIGABRT. All my searching has not revealed an answer. I figure there is something messed up in the compile switches.
 
I reduced it to a very simple occurence
void UTL_STR_RTRIM_1() {  
   try {
      int x = 99;
      throw x;
   }
   catch (int i) {
       mr_cout << L("Caught int within test case ") << i << std::endl;
 
    }
    catch (...) {
        mr_cout << L("Caught ... within test case ") << std::endl;
       }
    TEST_EQUAL(this, mr_utils::mr_string(L("This is a str")), mr_utils::TrimRight(L("This is a str  \t\n\r\0")));
}
 
So even, throwing and catching and int (tried it with other types and exceptions) will cause SIGABRT
 
Here is my make file for the shared object that is loaded (with above code) followed by makefile of executable that loads the shared object of test cases. Any ideas?
#
# 'make depend' uses makedepend to automatically generate dependencies 
#               (dependencies are added to end of Makefile)
# 'make'        build static lib 'libutils.a'
# 'make clean'  removes all .o and static lib files
#
 
# define the C compiler to use
CC = gcc
 
# define any compile-time flags
CFLAGS = -c
CFLAGS = -g
CFLAGS += -fPIC
CFLAGS += -fno-stack-protector
 
# define any directories containing header files other than /usr/include
INCLUDES =-Iinclude
INCLUDES +=-ICppTestCaseTests
INCLUDES +=-I../CppTestUtils/include
INCLUDES +=-I../CppTest/include
 
#INCLUDES +=-ICore/include
#INCLUDES +=-IDlls/include
 
#INCLUDES +=-IExceptions/include
#INCLUDES +=-IFactories/include
#INCLUDES +=-ILogging/include
#INCLUDES +=-IOutputs/include
#INCLUDES +=-IScriptReader/include
 

 
# define library paths in addition to /usr/lib
#   specify path using -Lpath, something like:
#LFLAGS = -L/home/newhall/lib  -L../lib
 
# define the CPP source files
SRCS = \
	source/dllmain.cpp							\
 

 
# define the CPP object files 
#
# This uses Suffix Replacement within a macro:
#   $(name:string1=string2)
#         For each word in 'name' replace 'string1' with 'string2'
# Below we are replacing the suffix .cpp of all words in the macro SRCS
# with the .o suffix
OBJS = $(SRCS:.cpp=.o)
 
# folder for lib file.
LIBDIR = lib
 
# define the shared object file
UTILLIB = $(LIBDIR)/libmr_testTestCases.so
 

DEFINES+=-DMR_USE_WIDE_STR
DEFINES+=-DDEBUG
 
# User defined function for compile to make for each compact. 
do-compile=$(CC) $(DEFINES) $(CFLAGS) $(INCLUDES) -c $1.cpp -o $1.o > stderr
 
#do-compile=$(CC) $(DEFINES) $(CFLAGS) $(INCLUDES) -c $1.cpp -o $1.o > stderr
 

 
# The following part of the makefile is generic; it can be used to 
# build any static lib just by changing the definitions above and by
# deleting dependencies appended to the file from 'make depend'
.PHONY: depend clean
 
all: $(UTILLIB)
	@echo  Simple compiler named libmrtest.so has been compiled
 

# rule to archive all of the object files into the static lib
# chains to the OBJS macro which calls the .cpp.o to do the compilation first.
# For some reason gcc does not send out text to stdout of stderr.  Must echo
# it
$(UTILLIB): $(SRCS) 
	
	mkdir -p $(LIBDIR)
 
	@echo ------------------------------------------------------------
	@echo Compiling object files.
	$(foreach i,$(SRCS:.cpp=),$(shell $(call do-compile,$i) ))
	@echo ------------------------------------------------------------
	
	
	#@echo ------------------------------------------------------------
	#@echo Creating lib
	#$(AR) $(ARFLAGS) $@ $(OBJS)
	#@echo ------------------------------------------------------------
 
	@echo ------------------------------------------------------------
	@echo Creating Shared Object
	ld -shared -soname $@ -o $@ $(OBJS)
 
#	$(CC) -shared -W1,-soname $@ -o $@ -fPIC $(SRCS)
 
#	ld -shared -init __nonWinCutTestCaseRegistrationMethod__ -soname $@ -o $@ $(OBJS)
 
#	$(CC) -Wall -shared -fPIC -W1,soname $@ -o $@ $(INCLUDES) $(SRCS)
 
#	$(CC) -shared -W1,-soname,$@ -o $@ $(OBJS)
#	$(CC) -Wall -shared -fPIC -W1,-soname,$@ -o $@ $(OBJS)
 
#this one may actually call the attr constructor on dll. but undefined symbols found
#	$(CC) -Wall -shared -fPIC -o $@ $(INCLUDES) $(SRCS)
 

	@echo ------------------------------------------------------------
 

#	ld -shared -soname $@ -o $@ /usr/lib/gcc/i686-linux-gnu/4.6.3/libgcc_s.so -lc -fno-stack-protector $(OBJS)
#	ld -shared -fno-stack-protector -soname $@ -o $@  $(OBJS)
#ld -shared -lc -fno-stack-protector -soname $@ -o $@  $(OBJS)
 

# TODO - lookup what the no-stack-protector might be doing
 
# this is a suffix replacement rule for building .o's from .cpp's
# it uses automatic variables $<: the name of the prerequisite of
# the rule(a .cpp file) and $@: the name of the target of the rule (a .o file) 
# (see the gnu make manual section about automatic variables)
#.cpp.o:
#	$(CC) $(CFLAGS) $(INCLUDES) -c $<  -o $@
 
clean:
	@echo ------------------------------------------------------------
	@echo Cleaning House
	@echo ------------------------------------------------------------
	$(RM) $(UTILLIB)
	$(RM) $(OBJS)
 

depend: $(SRCS)
	makedepend $(INCLUDES) $^
 
# DO NOT DELETE THIS LINE -- make depend needs it
 
Executable make file
#
# 'make depend' uses makedepend to automatically generate dependencies 
#               (dependencies are added to end of Makefile)
# 'make'        build static lib 'libutils.a'
# 'make clean'  removes all .o and static lib files
#
 
# define the C compiler to use
CC = gcc
 
# define any compile-time flags
CFLAGS = -c
CFLAGS = -g
CFLAGS += -fPIC
CFLAGS += -fno-stack-protector
 
# define any directories containing header files other than /usr/include
INCLUDES +=-I../CppTestUtils/include
INCLUDES +=-I../CppTest/include
INCLUDES +=-I../CppTest/Core/include
 

# define library paths in addition to /usr/lib
#   specify path using -Lpath, something like:
#LFLAGS = -L/home/newhall/lib  -L../lib
 
# define the CPP source files
SRCS = \
	source/CppTestDevConsole.cpp							\
 

 
# define the CPP object files 
#
# This uses Suffix Replacement within a macro:
#   $(name:string1=string2)
#         For each word in 'name' replace 'string1' with 'string2'
# Below we are replacing the suffix .cpp of all words in the macro SRCS
# with the .o suffix
OBJS = $(SRCS:.cpp=.o)
 
# folder for lib file.
LIBDIR = lib
 
# define the shared object file
UTILLIB = $(LIBDIR)/cutConsoleRunner
 
# the libs from the other Cut so
#LIBS+=-lstdc++
#LIBS+=-lcut_utils
#LIBS+=-ldl
#LIBS+=-lcut_test
 

LIBS+=-lcut_test
LIBS+=-lcut_utils
LIBS+=-ldl
LIBS+=-lstdc++
 

 

#until I can get groups and rights setup
#LIBDIRS+=-L/home/michael/opt/cut_test/lib
#LIBDIRS+=-L/usr/lib/gcc/i686-linux-gnu/4.6.3
LIBDIRS+=-L/usr/lib/gcc/i686-linux-gnu/4.6.3/
LIBDIRS+=-L/opt/cut_test/lib/
 

 

DEFINES+=-DMR_USE_WIDE_STR
DEFINES+=-DDEBUG
 
# User defined function for compile to make for each compact. 
do-compile=$(CC) $(DEFINES) $(CFLAGS) $(INCLUDES) -c $1.cpp -o $1.o > stderr
 
#do-compile=$(CC) $(DEFINES) $(CFLAGS) $(INCLUDES) -c $1.cpp -o $1.o > stderr
 

# The following part of the makefile is generic; it can be used to 
# build any static lib just by changing the definitions above and by
# deleting dependencies appended to the file from 'make depend'
.PHONY: depend clean
 
all: $(UTILLIB)
	@echo  Simple compiler named ConsoleRunner has been compiled
 

# rule to archive all of the object files into the static lib
# chains to the OBJS macro which calls the .cpp.o to do the compilation first.
# For some reason gcc does not send out text to stdout of stderr.  Must echo
# it
$(UTILLIB): $(SRCS) 
	
	mkdir -p $(LIBDIR)
 
	@echo ------------------------------------------------------------
	@echo Compiling object files.
	$(foreach i,$(SRCS:.cpp=),$(shell $(call do-compile,$i) ))
	@echo ------------------------------------------------------------
 
	@echo ------------------------------------------------------------
	@echo Objects $(OBJS)
	@echo Libs $(LIBS)
	@echo ------------------------------------------------------------
 
	@echo ------------------------------------------------------------
	@echo Linking into executable
#	ld -o $@ $(OBJS) $(LIBDIRS) $(LIBS)
 
#	ld -export-dynamic  $(OBJS) $(LIBDIRS) $(LIBS) -o $@
 
#	$(CC) -o $@ $(OBJS) $(LIBDIRS) $(LIBS)
#	$(CC) $(OBJS) $(LIBDIRS) $(LIBS) -o $@
	$(CC) -export-dynamic  $(OBJS) $(LIBDIRS) $(LIBS) -o $@
 

 
	@echo ------------------------------------------------------------
 

#$(LDFLAGS) $(CUT_LIBS)
 

#	@echo ------------------------------------------------------------
#	@echo Creating Shared Object
#	ld -shared -soname $@ -o $@ $(OBJS)
#	@echo ------------------------------------------------------------
 

#	ld -shared -soname $@ -o $@ /usr/lib/gcc/i686-linux-gnu/4.6.3/libgcc_s.so -lc -fno-stack-protector $(OBJS)
#	ld -shared -fno-stack-protector -soname $@ -o $@  $(OBJS)
#ld -shared -lc -fno-stack-protector -soname $@ -o $@  $(OBJS)
 

# TODO - lookup what the no-stack-protector might be doing
 
# this is a suffix replacement rule for building .o's from .cpp's
# it uses automatic variables $<: the name of the prerequisite of
# the rule(a .cpp file) and $@: the name of the target of the rule (a .o file) 
# (see the gnu make manual section about automatic variables)
#.cpp.o:
#	$(CC) $(CFLAGS) $(INCLUDES) -c $<  -o $@
 
clean:
	@echo ------------------------------------------------------------
	@echo Cleaning House
	@echo ------------------------------------------------------------
	$(RM) $(UTILLIB)
	$(RM) $(OBJS)
 

depend: $(SRCS)
	makedepend $(INCLUDES) $^
 
# DO NOT DELETE THIS LINE -- make depend needs it
 

AnswerRe: exceptions always SIGABRT in linux shared objectmvpRichard MacCutchan25 Sep '12 - 6:04 
Where does the SIGABRT get raised? You may need to add your own signal handler to trap it and take action accordingly.
One of these days I'm going to think of a really clever signature.

GeneralRe: exceptions always SIGABRT in linux shared objectmemberMichaelRoop25 Sep '12 - 11:02 
It is raised at the point where the exception is thrown. As you can see, unless I am totally missing something, the int is being thrown and properly caught so there should not be a signal raised at all. This is my dilema.
 
I put in a signal handler but it does no good. App still closes. I will need to handle the signals eventually since this is a unit tester. But for now, I am just trying to figure out why the SIGABRT could possibly be raised on a legitimate thrown and caught exception
 
This is the message at runtime:
 
terminate called after throwing an instance of 'int'
The program has unexpectedly finished.
 
Basically it acts as if there is no catch and the terminate is called. Or perhaps I am misreading something. The stack dump is below
 

0	__kernel_vsyscall		0	0xb7fdd424	
1	__GI_raise	raise.c	64	0xb7bd61ef	
2	__GI_abort	abort.c	91	0xb7bd9835	
3	__gnu_cxx::__verbose_terminate_handler()	/usr/lib/i386-linux-gnu/libstdc++.so.6	0	0xb7e1813d	
4	??	/usr/lib/i386-linux-gnu/libstdc++.so.6	0	0xb7e15ed3	
5	std::terminate()	/usr/lib/i386-linux-gnu/libstdc++.so.6	0	0xb7e15f0f	
6	__cxa_throw	/usr/lib/i386-linux-gnu/libstdc++.so.6	0	0xb7e1605e	
7	UtilStrTrimTests::UTL_STR_RTRIM_1	mr_util_str_trim_tests.cpp	31	0xb7b6d692	
8	MrTest::Fixture::ExecStep	CppTestFixture.cpp	178	0xb7f56d2a	
9	MrTest::Fixture::RunTest	CppTestFixture.cpp	160	0xb7f56c3c	
10	MrTest::EngineImplementation::RunAllFixtureTests	MrTestEngineImplementation.cpp	350	0xb7f71a89	
11	MrTest::EngineImplementation::ProcessTestList	MrTestEngineImplementation.cpp	227	0xb7f711fc	
12	MrTest::Engine::ProcessTestList	CppTestEngine.cpp	57	0xb7f48241	
13	main	CppTestDevConsole.cpp	94	0x804cb5c	
 

GeneralRe: exceptions always SIGABRT in linux shared objectmemberMichaelRoop25 Sep '12 - 13:45 
I found a solution to the SIGABRT problem. As I suspected it was a problem with the makefile. In particular, I changed
 
this:
ld -shared -soname $@ -o $@ $(OBJS)
 
to this:
$(CC) -shared -W1,-soname,$@ -o $@ $(OBJS)
 
It now behaves in the same way as in Windows. As long as I catch the exception properly it will never SIGABRT.
 
Seeing that I am not a linux guru, I would appreciate if someone out there has an explanation why a shared object linked with ld will not allow exceptions while one linked with gcc will.
 
It may also help anyone else having a similar problem. I looked far and wide and could find no documentation on this.
QuestionCppunit in Visual studio 2010memberRahul from Poona24 Sep '12 - 4:44 
Can anyone please explain me how to build and use cppunit in visual studio 2010?
I have tried a lot but not able to get it..
AnswerRe: Cppunit in Visual studio 2010memberChris Meech24 Sep '12 - 5:56 
Not sure if this will help, but look at this article[^]. Smile | :)
Chris Meech
I am Canadian. [heard in a local bar]
 
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
 
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

AnswerRe: Cppunit in Visual studio 2010memberAlbert Holguin24 Sep '12 - 6:43 
This question is kind of specific to this tool... so your best bet for support is their forums
http://sourceforge.net/projects/cppunit/support[^]
AnswerRe: Cppunit in Visual studio 2010memberjschell24 Sep '12 - 12:39 
Rahul from Poona wrote:
I have tried a lot but not able to get it..

 
Presumably you are using unmanaged C++ right?
QuestionLate Binding ConceptmemberAmbiguousName23 Sep '12 - 20:30 
Hello. I am little confused in Late Binding Concept (although I understand it theoretically) as I could not understand it programatically. I am defining two classes here and then casting and using their pointers.
 
CBaseClass

void CBaseClass::Function() // this is virtual function
{
cout<<"\nBase Class.";
}

 
CChildClass

void CChildClass::Function() // overriden virtual function
{
cout<<"\nChild Class.";
}

 
MainClass

void main()
{
CBaseClass* pBase = new cBaseClass();
CChildClass* pChild = (CChildClass*)pBase;
 
pBase->Function();
pChild->Function();
}

 
What should the two function calls produce in MainClass. I think it should produce

BaseClass.
ChildClass.

But it actually produces

BaseClass.
BaseClass.

What is wrong with my understanding. Thanks

This world is going to explode due to international politics, SOON.

AnswerRe: Late Binding ConceptmvpCPallini23 Sep '12 - 22:27 
The right main function ought be:
void main()
{
CBaseClass* pBase1 = new cBaseClass();
CBaseClass* pBase2 = new cChildClass();
 
pBase1->Function();
pBase2->Function();
}
Veni, vidi, vici.

AnswerRe: Late Binding ConceptmvpRichard MacCutchan23 Sep '12 - 23:05 
I just tried this and it produces the expected output:
Base Class.
Child Class.
One of these days I'm going to think of a really clever signature.

QuestionRe: Late Binding ConceptmvpCPallini23 Sep '12 - 23:58 
It maybe but
Are you sure? What compiler are you using? What code? What else? Smile | :)
 

Anyway
CBaseClass * pBase = new CBaseClass();
CChildClass * pChild = (CChildClass *) pBase;
is a gross mistake.
Veni, vidi, vici.

AnswerRe: Late Binding ConceptmvpRichard MacCutchan24 Sep '12 - 0:11 
Exactly so, but as so often happens, the OP has only given us part of the story.
One of these days I'm going to think of a really clever signature.

AnswerRe: Late Binding ConceptmvpRichard MacCutchan23 Sep '12 - 23:09 
The code you have shown above does not match the code you are using. If I change it to the following, then it produces the results that you see.
class CBaseClass
{
public:
	virtual void Function() // this is virtual function
	{
		cout<<"\nBase Class.";
	}
};
 
class CChildClass : CBaseClass
{
public:
	void Function() // overriden virtual function
	{
		cout<<"\nChild Class.";
	}
};
 
One of these days I'm going to think of a really clever signature.

AnswerRe: Late Binding Concept [modified]memberpasztorpisti24 Sep '12 - 1:09 
The bug in your code is obvious. CPallini already gave you the correct code but I feel this is something that needs further clarification.
The bug is the following, and its a major bug in its current context:
CChildClass* pChild = (CChildClass*)pBase;
There are 2 kinds of static casts: downcast and upcast. If you are drawing the uml diagram of your class hierarchy then it looks like a tree with its root node (base class) at the top of the diagram. Down and upcast are named based on the direction of the cast in this tree so an upcast means that you cast a derived class to one of its base classes in the hierarchy, this type of cast is safe, you don't have to mark it explicitly in your code because the compiler does it automatically for you:
Derived * d = new Derived;
Base* b = d;
However downcasts are not only dangerous but they usually mean that you committed a design mistake. A base class can have a lot of derived classes and if you are casting a base class to one of its derived classes than its a bug if the actual object isn't an instance of the downcast type or its descendants. People often say that dowcasts defeat the whole purpose of polymorphism/late binding. Example:
class Base;
class A : public Base;
class B : public Base;
Base* b = new B;
A* p = (A*)b; // huge mistake because b points to a B instance so the code that uses p can crash anytime if you are not lucky!!!!
 
So why doesn't your code crash??? Because you were lucky and currently in your simple example the binary representation of instances created by the compiler for your base and derived classes are probably identical, they just differ in their vtable pointer but in any more complex situations it could easily crash.
 
OK, so when you have a complex hierarchy and you call a virtual function on a base class pointer then which method is executed??? It depends on which object have you actually created! (with new). Since in your example you created just a Base instance it would be magic to see executing the method of the derived class, and its just luck that using the pointer that you filled with your invalid downcast haven't crashed your program.
 
So based on what we have learned up until now you should only use upcasts that are done automatically for you by the compiler, for example:
CBaseClass* p = new CChildClass; // the compiler automatically upcasts the CChildClass* to CBaseClass*
p->Function();                   // calls the Function of CChildClass because we created a CChildClass instance above!
Describing the same in other words:
You can always use a base class pointer to point to an object that was created by instantiating a class derived from the base class. This way if you call some virtual methods on the base class pointer then the methods of the actually instantiated class are called.

modified 24 Sep '12 - 14:17.

GeneralRe: Late Binding ConceptmvpCPallini24 Sep '12 - 1:41 
Thumbs Up | :thumbsup:
Veni, vidi, vici.

GeneralRe: Late Binding Conceptmemberpasztorpisti24 Sep '12 - 1:46 
Thanks!
GeneralRe: Late Binding ConceptmemberChris Meech24 Sep '12 - 2:19 
Thumbs Up | :thumbsup:
 
Good explanation about the perils of upcasting and downcasting and how in this simple example the downcasting worked, but that in a real world case, it would likely crash. Smile | :)
Chris Meech
I am Canadian. [heard in a local bar]
 
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
 
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

GeneralRe: Late Binding Conceptmemberpasztorpisti24 Sep '12 - 2:37 
Thank you!
AnswerRe: Late Binding ConceptmemberChuck O'Toole24 Sep '12 - 5:16 
+5. Great explanation. For me too, I've been reversing upcast and downcast terms, didn't think of the diagram. Saw the obvious error in his example though.
GeneralRe: Late Binding Conceptmemberpasztorpisti24 Sep '12 - 6:00 
Thank you!
GeneralRe: Late Binding Conceptmemberpasztorpisti24 Sep '12 - 6:19 
Regarding the upcast/downcast naming: A lot of coders exchange these names so when someone starts using them I always ask him to clarify how to interpret "his upcast" right at the start of the conversation. I also used them in reverse order for a long time until reading some uml docs that clarified it for me. For some reason thinking that upcast is casting up to a higher level smarter derived class seemed to be more logical for me. Smile | :)
GeneralRe: Late Binding ConceptmemberChuck O'Toole24 Sep '12 - 7:53 
Which is how I use "upcast", to a "bigger" container, the derived class. Of course, that's just a convenience notation. The real idea is
Cast Derived to Base - OK
Cast Base to Derived - Bad

QuestionCallBack FunctionmemberSmart Arab23 Sep '12 - 4:47 
Hi, have a good day
I am using Already built DLL , with callback function inside it :
 
After I execute this code my application freeze ( SomeCallback : read only once ) and freeze
 
I don't know what is wrong ?
 
DLL Define code ( DLL is open source ) :
typedef int __stdcall cbtype (char *what, Number int1, Number int2, char *str);
 
extern "C" int __cdecl FreeArcExtract (cbtype *callback, ...);
 

My Code :
#include <cstdlib>
#include <iostream>
#include "windows.h"
 
using namespace std;
 
typedef bool  (*cbtype)  (char *what, int, int, char *str);
 
bool SomeCallback( char *c1 , int i1 , int i2, char *c2)
{
     printf("%s\r\n" , c1);
     printf("%d\r\n" , i1);
     printf("%d\r\n" , i2);
     printf("%s\r\n" , c2);
     return true;
}
 
void ArcExtract ()
{  
	
	HINSTANCE GetProcDLL = LoadLibrary("unarc.dll");
    FARPROC GetProcessID = GetProcAddress(
HMODULE (GetProcDLL), "FreeArcExtract");
 
	typedef int (__cdecl * CallingFun)(cbtype, LPCTSTR , LPCTSTR, LPCTSTR , LPCTSTR,LPCTSTR , LPCTSTR,LPCTSTR , LPCTSTR,LPCTSTR , LPCTSTR);
 
    CallingFun FreeArcExtract;
    FreeArcExtract = CallingFun(GetProcessID);
	
	FreeArcExtract((cbtype)SomeCallback,
"l", "--", "d:\\test.arc", "", "", "", "", "", "", "");
    FreeLibrary(GetProcDLL);
}
 
int main(int argc, char *argv[])
{
    ArcExtract ();
    //system("pause");

    return EXIT_SUCCESS;
}
 
I think the error are in the call back function
 

I write the same code on C# and it's work like charming.
 
with same dll , and the same d:\test.arc
 
C# Code :
class ArcArchive
        {
            public delegate bool unarcCallBack(string what, int param1, int param2, string text2);
 
            [DllImport("unarc.dll")]
            public static extern int FreeArcExtract(unarcCallBack callback, 
string cmd1, string cmd2, string cmd3, string cmd4, string cmd5, string cmd6, string cmd7, string cmd8, string cmd9, string cmd10);
        }
 
        static void Main(string[] args)
        {
            ArcArchive.unarcCallBack ArcCallBack = new ArcArchive.unarcCallBack(CallBackFunction);
            ArcArchive.FreeArcExtract(ArcCallBack,
 "l", "--", "d:\\test.arc", "", "", "", "", "", "", "");
        }
 
        static bool CallBackFunction(string what, int param1, int param2, string t2)
        {
 
            Console.WriteLine(what);
            Console.WriteLine(param1);
            Console.WriteLine(param2);
            Console.WriteLine(t2);
            return true;
 
        }
 

please is there is anyway to write callback function in c++ ? or is my c++ code had some logical errors.
 
Thank you

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 19 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid