|
Granted most software for linux is open source, but even so there are usually pre built binaries which can be downloaded instead. There are even some software companies that refuse to release the sources for their linux binaries.
|
|
|
|
|
|
Well, that's simple: just distribute the exe and the resources and don't distribute your source code.
Or maybe I misunderstood your question...
|
|
|
|
|
Cedric Moonen wrote: Well, that's simple: just distribute the exe and the resources and don't distribute your source code.
But what if they somehow manage to track the .exe back to your office and rummage through your computer to find the corresponding source code? Whatcha gonna do then, Cedric?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If only I could give this ENTIRE THREAD a 5!
Thank you ALL!
LMAO
|
|
|
|
|
Hi all
I want to create a thread in a Win32 Console application . I added a class and in the constructor i call like this ...
CMyClass
{
public:
HANDLE hThreadID;
DWORD WINAPI ThreadFunc(LPVOID pParam);
}
... in myclass.cpp
CMyClass::CMyClass()
{
hThreadID=CreateThread(NULL,0,ThreadFunc,this,NULL,NULL);
}
But I get the following error when I compile it ...
rror C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)'
None of the functions with this name in scope match the target type
I have added afxwin.h in stdafx.h. I do not use MFC . IS there anything missing ?
redindian
|
|
|
|
|
Please, when posting code, use the pre tag !
Your problem is because you pass the address of a member function to your CreateThread function where it expects a global function. The difference is that they don't have the same prototype: for the member function, there is an extra parameter that is passed implicitely (the 'this' parameter).
The way to solve this is to pass a global function (or a static function of your class) to the CreateThread. If you need to run your thread in a member function of your class, then pass the this parameter as a parameter to your function and cast it back to the class in the thread function (so this way you can call a public function of your class).
|
|
|
|
|
Cedric Moonen wrote: Please, when posting code, use the pre tag !
thank you Cédric, I felt alone for some times
|
|
|
|
|
Wow...I got it . I tried both the things and now its ok ..
I changed my member function in the class as "static DWORD WINAPI ThreadFunc()" and also I removed this member function from the class and made it a global one . In both the cases it compiled properly .
Can I infer the following ?
1) Making a member function as static one makes the function (more or less) a global one .
Is it ok ?
redindian
|
|
|
|
|
dharani wrote: Making a member function as static one makes the function (more or less) a global one .
In fact declaring a static function in a class means that the function is accessible even when you don't have an instance of your class:
CMyClass::myStaticFun();
In that cas, you are able to access the function with the :: operator. Of course that also means that the function doesn't belong to any particular class instance, thus it cannot access any non-static member of your class (either metohd or variable).
|
|
|
|
|
Sorry for my ignorance ...whats a pre tag ?
redindian
|
|
|
|
|
dharani wrote: whats a pre tag
<pre></pre> allows you to post blocs of code properly (keeping the formatting)
|
|
|
|
|
dharani wrote: But I get the following error when I compile it ...
rror C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)'
None of the functions with this name in scope match the target type
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This doesn't directly address your problem but it is a potential problem with your code. In general you should ***NOT*** use CreateThread to create a thread if you're using the CRT in the thread. But don't take my word for it, see here[^] on MSDN. Here's a quote:
"A thread in an executable that calls the C run-time library (CRT) should use the _beginthreadex and _endthreadex functions for thread management rather than CreateThread and ExitThread; this requires the use of the multi-threaded version of the CRT. If a thread created using CreateThread calls the CRT, the CRT may terminate the process in low-memory conditions."
This is one of the most common mistakes; seasoned programmers often do it.
Steve
|
|
|
|
|
Hi All,
I'm pretty new to C++ programming that too VC++/MFC/Win32. I just tried using the CAnimationCtrl class to play some video file. I created a window which shows the video file in a full screen mode with some controls to play, pause and so on.
The video is playing fine, thanks to the class. But when the video is playing if any pop up or message box comes in the way of the screen, the area where the popuup or the message box is displayed gets blocked and the video at that portion is not visible.
Also if multiple windows are there and if i traverse from the video screen to some other window and come back, since the whole screen is blocked by someother window the whole screen(video) is blocked and i'm unable to see anything.
Sometimes if i shake the screen a bit then the video is visible and at times that doesn't work too.
If anybody faced a similar such issue and if there is any solution, please reply back to this message.
Thanks for your response in advance.
V V S
|
|
|
|
|
Hi,
I am using combo box in my WIN32 application and adding data at run time. Now I am not able to set height of list of that combo box during drop down position. Like even if I add 10 items in my combo box it shows only 2 items at drop down position and I have to scroll to see other items. I want to show at least 5-6 items in drop down position. Can I know how can I do this?
Thanks in advance,
Priyank.
|
|
|
|
|
In the resource editor, if you click on the arrow of the combo box, you'll be able to resize the height of the list (and not of the control).
|
|
|
|
|
Hi all
Can anyone pls tell me whats the Win32 equivalent of CPtrList . My application does not support MFC . I want non-MFC one ...
redindian
|
|
|
|
|
It depends what you are really doing with the CPtrList but maybe you can use a container class of the STL (the Standard Template Library) ?
Why not use std::list ?
|
|
|
|
|
U can use STL
It is better to use vector or list with void * as container
But it will not support for Cobject functionality
|
|
|
|
|
san123pune wrote: It is better to use vector or list with void * as contai
That is not very elegant because you will need to cast the void pointer back to its class when you want to delete it (otherwise, the destructor won't be called).
A better way to do that (if polymorphism is needed) is simply to have a list of pointers to the base class. So in that case when you delete all the elements of the array, the destructor will be called.
|
|
|
|
|
Hello Experts
I want to programmed a project that should be worked for ASCII as well as
UNICODE.What things i have to keep in mind.Please tell me.
I am using VS2003.
manu
|
|
|
|
|
I think u shd not use char * as it is not supported to UNICODE
Either use CString or TCHAR
Only this much I know
|
|
|
|
|
TCHAR is not UNICODE. it is only if UNICODE is explicitely defined. otherwise, it is ANSI char...
but it is the stuff to use
ps: stop typing as SMS. you are on a forum which plenty of people don't speak englisk naturally, so give them a chance to understand you
|
|
|
|
|
Sorry Buddy
|
|
|
|