|
Hi,
Thanks a lot for help!!
So, can I compare returned float value is -ve or +ve infinitive?
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Yes, have a look here [^] and here [^] (some background).
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
|
|
|
|
|
Hi,
Thanks a lot for all help!!
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Hello,
I want a user defined function that can be called by every process running.
That is: -
void HelloWorld()
{
MessageBox(NULL, L"Hello World", "Test", 0);
}
I need a mechanism by which this function can be called inside every running process.
|
|
|
|
|
tony_udz wrote: I need a mechanism by which this function can be called inside every running process.
Write your funtion in the DllMain() of a dll and inject it to the process you need using CreateRemoteThread() API. For more details see Three Ways to Inject Your Code into Another Process[^]
|
|
|
|
|
Thanks! for your reply.
In Windows CE CreateRemoteThread() API is not supported. I have tried out many options but could not find a way to inject DLL.
|
|
|
|
|
|
Hi
How to connect database using MFC?Replay ME
Regards
Nisha.S
|
|
|
|
|
You can use of CDaoDatabase class.
|
|
|
|
|
|
Maybe someone else can see the error. I can't (of course, as soon as I post this, I'll see it ).
typedef struct
{
BOOL bObsolete;
TCHAR sOn[16];
TCHAR sOff[16];
TCHAR sName[50];
ULONG nId;
} _MESSAGES_TYPE;
#define NUM_MESSAGES 260
const _MESSAGES_TYPE FeatureSetTable[NUM_MESSAGES] =
{ //<----- compiler error!!!!!!!!!!!!!!!!!!!!!
{ FALSE, _T("ON"), _T("OFF"), _T("Message 1"), NULL},
{ FALSE, _T("ON"), _T("OFF"), _T("Message 2"), NULL},
{ FALSE, _T("ON"), _T("OFF"), _T("Message 3"), NULL},
};
This results in a compiler error C2059 at the location above. For the life of me, I don't know why. Suggestions?
Charlie Gilley
Will program for food...
|
|
|
|
|
I couldn't see the error as well. Then I decided to compile it in a new project and it compiles fine. So I guess the error might be due to conflict from other parts of code.
-Saurabh
|
|
|
|
|
By the way I tried in VS 2008.
-Saurabh
|
|
|
|
|
Thanks. I'm in VS 6.0, and I don't see it. I suspect a conflict as well. Just can't see it.
Charlie Gilley
Will program for food...
|
|
|
|
|
How about trying to rename _MESSAGES_TYPE, NUM_MESSAGES, and FeatureSetTable. May be there is a macro with these names some where else.
-Saurabh
|
|
|
|
|
charlieg wrote: I'm in VS 6.0
I tried in VS 6. Compiled fine. I have installed SP5 of visual studio 6.
|
|
|
|
|
Well, it appears that it's important where the code posted lives in the class. I'm still not sure what the problem was (maybe some trash text I didn't see someplace). Anyway, I moved the code to the end of the class, and it built fine.
weird.... something more to learn
Charlie Gilley
Will program for food...
|
|
|
|
|
How to redirect com port data stream to my application.
|
|
|
|
|
You can read from the COm port using CreateFile() and ReadFile() . See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the reply. Actually I'm not reading/writing the com port but
intercept data sending to com port.
|
|
|
|
|
How?
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
|
|
|
|
|
hi
i used a "file type extension " article to create one of my own.
everything is going well except for the registry Key Type Constants:
when i run it , there are 18 errors of the same type which is :
error C2199: syntax error : found 'const short (' at global scope (was a declaration intended?)
please help me . this is afinal step in my graduation project
thanks in advance
/////////////////////////////////////////////////////////////////
// Windows Registry Root Key Constants.
/* const int HKEY_CLASSES_ROOT = &H80000000; */
/* const int HKEY_CURRENT_CONFIG = &H80000005 ;*/
/* const int HKEY_CURRENT_USER = &H80000001; */
/* const int HKEY_DYN_DATA = &H80000006 ;*/
/* const int HKEY_LOCAL_MACHINE = &H80000002; */
/* const int HKEY_USERS = &H80000003 ;*/
// Windows Registry Key Type Constants.
const short REG_OPTION_NON_VOLATILE =0; // Key is preserved when system is rebooted
const short REG_DWORD =4; // 32-bit number
const short REG_EXPAND_SZ =2; // Unicode nul terminated string
const short REG_SZ =1 ; // Unicode nul terminated string
const short REG_BINARY =3 ; // Free form binary
const short REG_DWORD_BIG_ENDIAN =5 ; // 32-bit number
const short REG_DWORD_LITTLE_ENDIAN =4 ; // 32-bit number (same as REG_DWORD)
// Function Error Constants.
const short ERROR_SUCCESS =0;
const short ERROR_REG =1;
// Registry Access Rights.
const int SYNCHRONIZE = &H100000;
const int READ_CONTROL = &H20000;
const int STANDARD_RIGHTS_ALL = &H1F0000;
const int STANDARD_RIGHTS_READ = (READ_CONTROL);
const int STANDARD_RIGHTS_WRITE = (READ_CONTROL);
const short KEY_QUERY_VALUE = &H1;
const short KEY_SET_VALUE = &H2;
const short KEY_CREATE_LINK = &H20;
const short KEY_CREATE_SUB_KEY = &H4;
const short KEY_ENUMERATE_SUB_KEYS = &H8;
const short KEY_NOTIFY = &H10;
const int KEY_READ = ((STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE));
const int KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE));
const int KEY_EXECUTE = ((KEY_READ) And (Not SYNCHRONIZE));
const int KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE));
// Windows Registry API Declarations.
// Registry API To Open A Key.
int RegOpenKeyEx /*RegOpenKeyExA*/ (int hKey, Cstring lpSubKey, int u1Options, int samDesired, int& phkResult); //"advapi32.dll"
// Registry API To Create A New Key.
int RegCreateKeyEx /*RegCreateKeyExA*/ (int hKey, CString lpSubKey, int Reserved, CString lpClass, int dwOptions, int samDesired, int lpSecurityAttributes, int& phkResult, int lpdwDisposition);//"advapi32.dll"
// Registry API To Query A String Value.
int RegQueryValueExString /*RegQueryValueExStringA */ (int hKey, CString lpValueName, int lpReserved, int& lpType, CString lpData, int& lpcbData);//"advapi32.dll" Alias "RegQueryValueExA" _
// Note that if you declare the lpData parameter as String, you must pass it By Value.
//Registry API To Query A Long (DWORD) Value.
int RegQueryValueExLong /* RegQueryValueExLongA */(int hKey, CString lpValueName, int lpReserved, int& lpType, int& lpData, int& lpcbData); //"advapi32.dll"
// Registry API To Query A NULL Value.
int RegQueryValueExNULL /* RegQueryValueExA */ (int hKey, CString lpValueName, int lpReserved, int& lpType, int lpData, int& lpcbData);//"advapi32.dll"
// Registry API To Set A String Value.
int RegSetValueExString /* RegSetValueExA */(int hKey, CString lpValueName, int Reserved, int dwType, CString lpValue, int cbData);// "advapi32.dll"
// Note that if you declare the lpData parameter as String, you must pass it By Value.
// Registry API To Set A Long (DWORD) Value.
int RegSetValueExLong /* RegSetValueExA */ (int hKey, CString lpValueName, int Reserved, int dwType, int& lpValue, int cbData);//"advapi32.dll"
// Registry API To Delete A Key.
int RegDeleteKey /* RegDeleteKeyA */ (int hKey, CString lpSubKey); //"advapi32.dll"
// Registry API To Delete A Key Value.
int RegDeleteValue /* RegDeleteValueA */ (int hKey, CString lpValueName ); //"advapi32.dll"
// Registry API To Close A Key.
int RegCloseKey (int hKey); // "advapi32.dll"
//Constants For Error Messages.
const CString OpenErr = "Error: Opening Registry Key!";
const CString DeleteErr = "Error: Deleteing Key!";
const CString CreateErr = "Error: Creating Key!";
const CString QueryErr = "Error: Querying Value!";
#endif // !defined(AFX_FILE_COMMANDS_
//////////////////////////////////////////////////
lahom
|
|
|
|
|
lahom wrote: error C2199: syntax error : found 'const short (' at global scope (was a declaration intended?)
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks
but I have seen this "link" before and i couldn't figure that out in my problem .
I tried to define the register type key first then assign it to some value like this:
const short REG_OPTION_NON_VOLATILE;<br />
REG_OPTION_NON_VOLATILE =0; but it didnt work .
so iam stuck now at this point.
pleeease ... help me
again ...thank u.
lahom
|
|
|
|
|
lahom wrote: const short REG_OPTION_NON_VOLATILE;
REG_OPTION_NON_VOLATILE =0;but it didnt work .
This has already been defined in winnt.h .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|