c++

Static Linking Function in a DLL Project

I don't know why but I thought I could statically link a function from an Import Library. It would seem I am the only one who has ever tried because I can't for the life of me find a similar post. Is there a way to selectively static link functions from a dynamically linked project without creating a new project and/or recompiling it a...

C++: Problem with overloading mathematical operators.

I am looking to overload, let's say, the addition operator and have it add two objects of the same class. When I declare this "operator+" prototype function in the class declaration in the header file, I pass in both objects as parameters. I get a compiler error saying that "binary 'operator +' has too many parameters". I was searchin...

How to Create a webservice by QT

I am looking for a tool or plugin that help me to create web service as DOT NET does for Linux thanks =============================== After search, I found that Qt has not any thing to write web services gSOAP is an Open Source Solution for this problem, currently we use it. ...

C++: How to add external libraries

I'm trying to add SVL to my project. Without it I'm getting hundreds of errors (undefined reference...). After adding -lSVL all errors are gone, but gcc says: "cannot find -lSVL". Everything else (SDL, SDL_TTF, SDL_Mixer...) works fine. ...

Transferring files from disk (Linux on virtual machine) to Windows shared folder?

Hi, I'm using RedHat on a Hyper-V virtual machine. I need to copy files from the CD (captured to the Redhat VM) into a Windows shared network folder. After copying some files, the windows side pops up an "Invalid MS-DOS function" message, although everything looks fine from the Linux side. What could be the reason for that? Do I need t...

C++: Difference between NVI and Template Method Patterns?

What is the difference between NVI ( Non-Virtual Interface ) and the Template Method patterns? They seem very similar and I've read both that they're basically the same and that they're subtly different with Template being somehow more general. ...

Get name of function

Hello, are there any ways to get function signature/name from it's pointer? Like: void test(float data) {} cout << typeid(&test).name(); I wan't to use this data for logging. ...

Learning programming in general - virtual mentoring

I know some programming. I know little bit of Java, I know some C#, I know some GW Basic. I've followed those 30 minute Ruby, Python tutorials and so on. I took some computer courses in college but didn't take them very seriously at that time. After I finished school, I got an IT job but my luck (or bad luck) I ended up doing non-coding ...

Help with defines

Hello, I have some big code line which I want to pack into define for fast using. EventManager::get_mutable_instance().get<EventManager::KeyEvent>("KeyPressed").Call(EventManager::KeyEvent::ArgsType(localEvent.Key)); Here is EventManager is singleton class. I'd prefer to pass into define only EventManager::KeyEvent type and signal nam...

unsigned _stdcall.... implicitly an int??

A function with this signature: unsigned _stdcall somefunction (LPVOID lParam); does it mean that it implicitly returns an integer? As unsigned really isn't a value by itself? And _stdcall is a calling convention.... ...

An Alternative OO Language to C++ with Similar Powers ?

Greetings All, I'm looking for an OO language that support pointers and (if possible) GC. Though it would be nice NOT to enforce GC and allow for override/customize it. I'm open to both VM and binary executable languages. I'm looking for a consistent and proactively developed/supported OO language to do development with. Maybe I am no...

c++ must delete a references?

hello community, how are you? in the following code: class x { private: someRef& m_ref; public: x(someRef& someRef):m_ref(someRef) { } do I need to do: ~x() { delete m_ref; } which by the way doesnt work without getting the pointer... basically I'm asking: Do I need to call a destructor on a reference member? ...

Size of empty class and empty function ??

Hi Friends, What will be solution in the fallowing code Class A{} void func(){} printf("%d,%d",sizeof(A),sizeof(func)); Thanks in advance Prashant Dubey ...

Getting shared_ptr to call a member function once its reference count reaches 0

I'm creating a wrapper for a HANDLE that does not work with DuplicateHandle, so instead I am trying to wrap the handle in a shared_ptr. Imagine the following code: class CWrapper { public: CWrapper() : m_pHandle(new HANDLE, &CWrapper::Close) { //code to open handle } private: void Close() { ...

Learning programming in general - virtual mentoring

I know some programming. I know little bit of Java, I know some C#, I know some GW Basic. I've followed those 30 minute Ruby, Python tutorials and so on. I took some computer courses in college but didn't take them very seriously at that time. After I finished school, I got an IT job but my luck (or bad luck) I ended up doing non-coding ...

why can I not get access to my DLL function

I'm trying to load a DLL dynamically using LoadLibrary(), which works, however I cannot then get the address of the function in the DLL that I'm trying to call. DLL function: (in CPP file) _declspec(dllexport) void MyDllFunc() { printf("Hello from DLL"); } Calling code: typedef void (*MyDllFuncPtr)(); int _tmain(int argc, _TCHA...

2D OpenGL scene slows down with lots of overlapping shapes

I'm drawing 2D shapes with OpenGL. They aren't using that many polygons. I notice that I can have lots and lots of shapes as long as they don't overlap. If I get a shape behind a shape behind.... etc.. it really starts lagging. I feel like I might be doing something wrong. Is this normal and is there a way to fix this (I can't omit rende...

Creating a custom context menu Window (WinAPI)

I'm wondering how to create windows like these I'm refering to the one that says Marquee selection tool... these ones. I'm also not referring to the skin. I know how to do my own drawing and what not, this is not the issue. It's because windows usually need a parent which means it should not be possible for these windows to overlap int...

Auto Completion in VS 2010

Hello, I'm currently trying VS2010 and while it's smooth, good looking, sexy would I even add, I've met a MAJOR Turn off, being still a big teen noob in C and C++, I need my AUTO Completion until I learn some of the lib's members. I tried toggling the CTRL+ALT+SPACE Option, using the hotkeys, the Button in the EDIT Tab is disabled (grey...

RegOpenKeyEx return ERROR_SUCCESS but it shouldn't (windows 7)

Hi, I've got a problem about RegOpenKeyEx, the code: #include <tchar.h> #include <stdio.h> #include <windows.h> #pragma comment (lib, "Advapi32.lib") int main () { TCHAR *keyName = _T("SOFTWARE\\foobar2000\\capabilities"); HKEY key = NULL; if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, KEY_ALL_ACCESS, &key) != ERROR_SUC...