|
Start windows in safe mode. Run various tools to see if they can uninstall the offender. If not, track down the offending app and the one that starts in and delete them. (If you know the name of the EXE, that can help in searching for a cleaner.)
Also look in both the services module in administrative tools, but also the registry for a service that is likely restarting this (the google updater program does this.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
How to find weather the thread is alive when using
somthing like..
hThread = (HANDLE)_beginthread()
while (hThread==Alive)
{
// do some thing
}
|
|
|
|
|
may not be an exact answer, but you can try this
make a flag 1 at the begining of the thread and make it 0 while returning.
use this in your primary thread.
while(flag==1)
{
//do some thing
}
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
That may not work for me because I use BASE_ASSERT in thread fucntion
is there any work around
hThread = (HANDLE)_beginthread(ThFunction)
bDone=FALSE;
while (bDone != TRUE)
{
}
unsigned __stdcall ThFunction (void* param)
{
..........
..........
BASE_ASSERT(SomeFunction);
bDone = TRUE;
return 1;
}
|
|
|
|
|
could you find out what happens to the thread handle value when the thread is not running?
also explore getexitcodethread api in msdn
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Hello Electron,
You can use GetExitCodeThread()[^]. If the function returns STILL_ACTIVE, then your thread is alive.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
But Can I use GetExitCodeThread() with out using AfxBeginThread(), becasue in this case I am using _beginthreadex()..
Is that safe ?
|
|
|
|
|
Hi Electron,
Sure you can. GetExitCodeThread() just needs thread handle and _beginthreadex() will return handle if it creates thread successfully. Have a look at the documentation from MSDN.
If successful, each of these functions returns a handle to the newly created thread.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Yes I did, Thank you
|
|
|
|
|
A negative vote for help?
Just kidding.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I am using Visual Studio 2008 on a 64 bit XP Machine.
I have been trying to use a DFT or FFT library for C++ for a couple of days. I have had no luck.
I tried using FFTW from fftw.org but when i try to link against it..the functions below always seem to undefined. I build the project as a 64 bit Static and 64 bit Dynamic.
error LNK2019: unresolved external symbol fftw_execute referenced in function main Temp.obj Temp
error LNK2019: unresolved external symbol fftw_plan_dft_1d referenced in function main Temp.obj Temp
Ererror LNK2019: unresolved external symbol fftw_malloc referenced in function main Temp.obj
fatal error LNK1120: 3 unresolved externals C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Temp\x64\Debug\Temp.exe Temp
These errors are from running a simple FFTW Program
#include "stdafx.h"
#include "fftw3.h"
#pragma comment(lib,"libfftw.lib");
//#include <complex.h>
#define N 100
int _tmain(int argc, _TCHAR* argv[])
{
fftw_complex *in,*out;
fftw_plan p;
in=(fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N);
out=(fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N);
p=fftw_plan_dft_1d(N,in,out,FFTW_FORWARD,FFTW_ESTIMATE);
fftw_execute(p);
return 0;
}
Even the Dynamic version created these errors. Can anybody help me?
Are there any easy to use FFT librarys that you are aware of? It needs to run on a 64 bit machine.
Thanks
|
|
|
|
|
jobin007007 wrote: I tried using FFTW from fftw.org
Why don't you try to compile the library on your system?
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]
|
|
|
|
|
Thats what I did!!.
If you have any fftw that compiles fine in 64 bit computer in Visual Studio 2008 EITHER STATIC OR dynamic, could you send it to me?
|
|
|
|
|
Hai:
Any body help me
i m working in c# application. i need algorithm to our application. but i have that algorithm in c++. so i converted c++ to Vc++ application using Vc++ console wizard Express Edition 2008 .after that created a dll then used in c# application . but put Entry point Exception occurred. i thing, i was used wrong wizard. which wizard want to used. and what are step are followed to this scenario..
Please Help me soon....
|
|
|
|
|
anishkannan wrote: but i have that algorithm in c++. so i converted c++ to Vc++ application using Vc++ console wizard Express Edition 2008 .
You may also convert it (crafting by hand) in C# , I suppose.
anishkannan wrote: but put Entry point Exception occurred.
What was exactly the error? When it occurred? You should be detailed and precise when reporting error (you should also possibly report both the DLL and the calling relevant code).
anishkannan wrote: what are step are followed to this scenario..
One simple path is what you've actually done: build a DLL (compliant with system ones) and then use Platform Invoke , see, for instance [^].
anishkannan wrote: Please Help me soon....
Do you know, you loosed man points for 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]
|
|
|
|
|
Thank you for the replay
I was created a dll using Console application of Vc++ Express Edition. After that i used the dll in sample C# application (Used in same system and also same platform)
My code is
[DllImport("Hash.dll",EntryPoint = "getHashCode" ) ]
static extern int getHashCode();
static void Main(string[] args)
{
try
{
Console.WriteLine(getHashCode());
Console.ReadKey();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
I got this Exception
Unable to find an entry point named 'getHashCode' in DLL 'Hash.dll'.
Thankyou
|
|
|
|
|
Can you see the exported getHashCode with, for instance, Depends tool?
What I mean: Is the function correctly exported? Could you show, please, the relevant DLL code?
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]
|
|
|
|
|
yes, same function name used here.
This is the Vc++ code.
#include "stdafx.h"
#include "HashTable.h"
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
return 0;
}
static int getHashCode()
{
const char* name="bhjbhj";
HashTable g;
return g.hashPJW(name);
}
Thank you
|
|
|
|
|
That doesn't look like an ordinary DLL exporting functions like system libraries do.
AFAIK DLL should have a DLLMain entry point (instead of main) and so on.
Why are you building a DLL with managed C++ ? Cannot you simply code it using C# ?
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]
|
|
|
|
|
so what i do, create proper one. want to used any specific wizard.
Thankyou...
|
|
|
|
|
Why don't you answer to my questions? Why do you need a C++ DLL if the Framework is involved? Cannot you simply write a C# function?
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]
|
|
|
|
|
ya possible to write C# code. but why i am trying like this, in our application need some more algorithm to further development that also have c++ code. which is not possible to write c# code . thats may take more time. But c++ code is working properly also tested. so only we are going c++ code.
Thankyou
|
|
|
|
|
In order to build an ordinary DLL with Visual Studio (at least the 2005 one), you may choose Win32 project and then DLL in the Application Settings window.
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]
|
|
|
|
|
Hi,
I already download the example code and try to connect to MySQL using "mysql-connector-c++-noinstall-1.0.5-win32-vs2005".
The problem that I'm facing is, I can't even compile the code-error:
fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
The example program that I used is as below. I already change the setting, include the HEADER file and INCLUDE file while compiling, but still got error.:
#include "mysqlplus.h"
#include <stdio.h>
sql_connection_c::sql_connection_c()
{
host = user = password = database = 0;
opendbbase = 0;
errc = 0;
}
sql_connection_c::sql_connection_c( char *__database, char *__host, char *__user, char *__password )
{
host = user = password = database = 0;
opendbbase = 0;
errc = 0;
connect( __database, __host, __user, __password );
}
sql_connection_c::~sql_connection_c()
{
if ( host )
{
delete[] host;
host = 0;
}
if ( user )
{
delete[] user;
user = 0;
}
if ( password )
{
delete[] password;
password = 0;
}
if ( database )
{
delete[] database;
database = 0;
}
OPENDB *odb;
for ( odb = opendbbase; odb; odb = odb->next )
{
mysql_close( &odb->mysql );
}
while ( opendbbase )
{
odb = opendbbase;
opendbbase = opendbbase->next;
if ( odb -> busy )
{
}
delete odb;
}
}
void sql_connection_c::connect( char *__database, char *__host, char *__user, char *__password )
{
host = new char[ strlen( __host ) + 1 ];
strcpy( host, __host );
if ( __user )
{
user = new char[ strlen( __user ) + 1 ];
strcpy( user, __user );
}
if ( __password )
{
password = new char[ strlen( __password ) + 1 ];
strcpy( password, __password );
}
database = new char[ strlen( __database ) + 1 ];
strcpy( database, __database );
freedb( grabdb() ); }
OPENDB *sql_connection_c::grabdb()
{
OPENDB *odb;
for ( odb = opendbbase; odb; odb = odb->next )
{
if ( !odb->busy )
{
break;
}
}
if ( !odb )
{
odb = new OPENDB;
if ( !mysql_init( &odb->mysql ) )
{
errc = 1;
}
if ( !mysql_connect( &odb->mysql, host, user, password ) )
{
errc = 2;
}
if ( mysql_select_db( &odb->mysql, database ) )
{
errc = 3;
}
odb->busy = 1;
odb->next = opendbbase;
opendbbase = odb;
}
else
{
odb->busy++;
}
return odb;
}
void sql_connection_c::freedb( OPENDB *odb )
{
odb->busy = 0;
}
short sql_connection_c::errcode()
{
return errc;
}
sql_query_c::sql_query_c()
{
sql_connection = 0;
odb = 0;
res = 0;
row = 0;
results.set_size( 0 );
}
sql_query_c::sql_query_c( sql_connection_c *__sql_connection )
{
sql_connection = __sql_connection;
odb = sql_connection->grabdb();
res = 0;
row = 0;
results.set_size( 0 );
}
sql_query_c::sql_query_c( sql_connection_c *__sql_connection, char *sql )
{
sql_connection = __sql_connection;
odb = sql_connection->grabdb();
res = 0;
row = 0;
try_execute( sql );
results.set_size( 0 );
}
sql_query_c::~sql_query_c()
{
for ( int idx = 0; idx < results.n_items(); idx++ )
{
delete results[ idx ];
results[ idx ] = 0;
}
if ( res )
{
mysql_free_result( res );
}
if ( odb )
{
sql_connection->freedb( odb );
}
}
int sql_query_c::try_execute( char *sql )
{
if ( sql_connection && odb && !res )
{
if ( !mysql_query( &odb->mysql, sql ) )
{
return 1;
}
}
return 0;
}
int sql_query_c::execute( char *sql )
{
if ( sql_connection && odb && !res )
{
if ( try_execute( sql ) )
{
res = mysql_store_result( &odb->mysql );
}
}
return (int)res;
}
sql_result_c *sql_query_c::store()
{
if ( !res )
{
return 0;
}
sql_result_c *p = new sql_result_c( this, res );
results.add( p );
res = 0;
return p;
}
void sql_query_c::free_result( sql_result_c *sql_result )
{
for ( int idx = 0; idx < results.n_items(); idx++ )
{
if ( results[ idx ] == sql_result )
{
delete results[ idx ];
results[ idx ] = 0;
results.del( idx );
break;
}
}
}
void sql_query_c::free_result()
{
if ( sql_connection && odb && res )
{
mysql_free_result( res );
res = 0;
row = 0;
}
}
__int64 sql_query_c::insert_id()
{
if ( sql_connection && odb )
{
return mysql_insert_id( &odb->mysql );
}
return -1;
}
MYSQL_FIELD *sql_query_c::fetch_field()
{
if ( sql_connection && odb && res )
{
return mysql_fetch_field( res );
}
return 0;
}
char *sql_query_c::fetch_fieldname()
{
MYSQL_FIELD *field = 0;
if ( sql_connection && odb && res )
{
field = mysql_fetch_field( res );
}
return field ? field->name : "";
}
int sql_query_c::ping()
{
if ( odb )
{
return mysql_ping( &odb->mysql );
}
return -1;
}
sql_var_c::sql_var_c()
{
value = 0;
}
sql_var_c::sql_var_c( int i )
{
value = 0;
*this = i;
}
sql_var_c::sql_var_c( double d )
{
value = 0;
*this = d;
}
sql_var_c::sql_var_c( char *s )
{
value = 0;
*this = s;
}
sql_var_c::sql_var_c( const char *s )
{
value = 0;
*this = (char *)s;
}
sql_var_c::~sql_var_c()
{
release();
}
sql_var_c::operator int ()
{
if ( !value )
{
return 0;
}
return atoi( value );
}
sql_var_c::operator double ()
{
if ( !value )
{
return 0;
}
return atof( value );
}
sql_var_c::operator char * ()
{
return value;
}
sql_var_c::operator const char * ()
{
return value;
}
sql_var_c::operator = ( int i )
{
release();
value = new char [ 11 + 1 ];
itoa( i, value, 10 );
}
sql_var_c::operator = ( double d )
{
release();
value = new char [ 32 ];
sprintf( value, "%15.5f", d );
}
sql_var_c::operator = ( char *s )
{
release();
value = new char [ strlen( s ) + 1 ];
strcpy( value, s );
}
sql_var_c::operator = ( const char *s )
{
*this = (char *)s;
}
void sql_var_c::release()
{
if ( value )
{
delete[] value;
value = 0;
}
}
sql_row_c::sql_row_c()
{
row = 0;
__allow_null = 1; }
sql_row_c::sql_row_c( MYSQL_ROW __row )
{
row = __row;
__allow_null = 1; }
void sql_row_c::allow_null( int allow )
{
__allow_null = allow;
}
sql_var_c sql_row_c::operator [] ( int idx )
{
return sql_var_c( __allow_null ? ( row[ idx ] ) : ( row[ idx ] ? row[ idx ] : "" ) );
}
sql_field_c::sql_field_c()
{
field = 0;
}
sql_field_c::sql_field_c( MYSQL_FIELD *__field )
{
field = __field;
}
char *sql_field_c::get_name()
{
return field->name;
}
char *sql_field_c::get_default_value()
{
return field->def;
}
enum_field_types sql_field_c::get_type()
{
return field->type;
}
unsigned int sql_field_c::get_max_length()
{
return field->max_length;
}
sql_result_c::sql_result_c()
{
query = 0;
res = 0;
}
sql_result_c::sql_result_c( sql_query_c *__query, MYSQL_RES *__res )
{
query = __query;
res = __res;
}
sql_result_c::~sql_result_c()
{
if ( res )
{
mysql_free_result( res );
}
}
__int64 sql_result_c::n_rows()
{
if ( query && res )
{
return mysql_num_rows( res );
}
return 0;
}
sql_row_c sql_result_c::fetch_row()
{
MYSQL_ROW row = mysql_fetch_row( res );
return sql_row_c( row );
}
unsigned int sql_result_c::n_fields()
{
if ( query && res )
{
return mysql_num_fields( res );
}
return 0;
}
sql_field_c sql_result_c::fetch_field( unsigned int field_idx )
{
if ( query && res )
{
MYSQL_FIELD *field = mysql_fetch_field_direct( res, field_idx );
return sql_field_c( field );
}
return sql_field_c();
}
|
|
|
|
|
6kyAngel wrote: fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
Well, the error is clear: the compiler is not able to find mysql.h include file. You've to tell the compiler where it can find such header file. For instance, using Visual Studio 2005 , choose the menu item Project->Properties , then select the Configuration Properties->C/C++->General node and add the proper folder in the Additional Include Directories item.
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]
|
|
|
|