|
hi vc++ programmers,,
i am getting the following errors in migrating my code from vs-2--3 to vs-2008...
FeeEnterView.obj : error LNK2019: unresolved external symbol "public: __thiscall ATL::CTime::CTime(void)"
and
fwstissr.obj : error LNK2001: unresolved external symbol ___security_cookie
can enbody show a remedy for this....thanks in advance
modified on Wednesday, September 9, 2009 11:04 AM
|
|
|
|
|
Hi,
I have couple of text files in JAR. I want to access them in my C++ application. Basically I want to get the FILE pointer to those file. Please let me know how would we do it.
thanks in advance
Umrahi...
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
See here for ideas.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Why don't you use the jar tool to decompress the files?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Judging from the header, they are simple ZIP files. Try one of the ZIP/UNZIP classes here on CP to access them.
|
|
|
|
|
I am creating a vs2005 vc++ application and trying to get a secondary thread setup and working. I have read through the various postings and tried to put some code together but it won't compile.
I am trying to start the new thread from a menu item via a message handler based in my application's 'CView' based class. I have created a new class of my own (GcWorkerThread) and is derived from CWinThread, and contains a member function 'GcThreadFunction'
calling code:
int x;
CWinThread *pThread = AfxBeginThread (GcThreadFunction, x);
UINT GcWorkerThread::GcThreadFunction (LPVOID pParam)
{
int t;
for (int y=0; y<1000000; y++
{
}
}
When is comes to compiling the code I get an error:
"Error C3867 'GcWorkerThread::GcThreadFunction' function call missing argument list
use &GcWorkerThread::GcThreadFunction to create a pointer to member"
What am I doing wrong?
|
|
|
|
|
You cannot pass a instance method to AfxBeginThread . You've to pass a standard function or a class (i.e. static ) method.
BTW: have a look at this [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
try with the following change.
int x;
CWinThread *pThread = AfxBeginThread (GcThreadFunction, &x);
Thanks and Regards,
Selvam,
http://www.wincpp.com
|
|
|
|
|
GC104 wrote: I have read through the various postings and tried to put some code together but it won't compile.
Instead of reading through the various postings I can suggest reading this[^] useful article about worker threads.
[edit] Sorry I didn't see that CPallini have already gave this link [\edit]
Regards
Nuri Ismail
|
|
|
|
|
Info gratefully received, I have gone away and think I now have a better understanding of what a 'static member function' is all about. However I'm struggling with the example given on the link given. see below:
static UINT run(LPVOID p);
void run();
volatile BOOL running;
To start a thread, your handler does
void CMyView::doInvert()
{
running = TRUE;
AfxBeginThread(run, this);
}
UINT CMyView::run(LPVOID p)
{
CMyView * me = (CMyView *)p;
me -> run();
return 0;
}
void CMyView::run()
{
for(int x=y = 0; running && y < image.height; y++)
for(int x = 0; running && x < image.width; x++)
changePixel(x, y);
running = FALSE;
}
|
|
|
|
|
// why is a 'this' pointer passed as the pParam?
Because of what static functions implies: a static function is shared among all instances of a class. This means that within a static function, you cannot access non-static members of the class. In order to be able to do so, you need to identify which instance you want to manipulate. This is the reason why you pass the instance as a parameter to the thread function.In fact, a static function is similar to a global function in this context.
//why is 'p' cast from something that already seems to be
//a CMyView pointer already?
Because it is received as a LPVOID, which doesn't mean anything. So, to be able to call the Run function on the instance, the compiler needs to know that it is a CMyView object (it can't guess it).
|
|
|
|
|
Just adding to the previous reply
GC104 wrote: // why is a 'this' pointer passed as the pParam?
Because inside the worker thread, a CMyView object is being manipulated (in this case). This particular thread function needs a CMyView object be passed to it.
Note: However, it would be a lot better if threads can accept any object (or data type) passed as the parameter in general. Because different threads do different things. Some threads won't require anything at all. Therefore, the best approach would be to pass a pointer to "something". And this something is known to the calling code (it sets up the parameter) and the thread also know what exactly is the pointer pointing to and so you cast it to the appropriate type.
GC104 wrote: //why is 'p' cast from something that already seems to be
p is a pointer to void (remember that LPVOID is nothing but void * ). Therefore, you must cast it to an appropriate type (read my note above?)
Hope that helps.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Many thanks for help given, I now have a basic 'thread' the compiles and does roughly what I expect
|
|
|
|
|
Hi All,
How do I rename a newly created pst folder 'Personal Folders'
in Microsoft Outlook programmatically.
Any script (vb OR VC++ COM, automation, etc.) or a bit of
guidance would be helpful
Thanks in Advance
|
|
|
|
|
|
Just refer [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
hello all,
I am using iaxclient.dll for making IAX based soft-phone.I wanted to create conference with this dll. Can anyone suggest me how to use this dll for creating a conference??????
Regards
New_bie
|
|
|
|
|
make the question in details to get answer, otherwise no will answer it, since this information is too little to understand
Величие не Бога может быть недооценена.
|
|
|
|
|
Have you checked the iaxclient documentation?
|
|
|
|
|
hi all,
I am getting the following error when i am converting my project from vs-2003 to vs-2008.
CVTRES : fatal error CVT1100: duplicate resource. type:DIALOG, name:PRINTSTATUS, language:0x0409
But i dont have an id for my dialog...if i keep an id then i am getting more linking errors...can anybody help,,,thanks in advance
|
|
|
|
|
can you check resource.h for duplicate resource IDs.
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi
But in my resource.h,i dont have an id for this dialog even,even though i dont have an id for this dialog i am getting ths error..
|
|
|
|
|
so not even a single duplicated ID in that resource.h?
if not then disable incremental linking.
Величие не Бога может быть недооценена.
|
|
|
|
|
no..i dont have an id for this dialog..i defined some id and seen,but this time i am getting 17345 linking errors(LNK ERROR 2005:_declarespec....)
|
|
|
|
|
i dont think you have to define it, well, what type of application is this?
Величие не Бога может быть недооценена.
|
|
|
|