|
Hello, I'm going to code an own small kernel, but I have a problem concerning the compiler to use.
I want to use Microsoft compilers, but there is the problem, that these compiler always what to create PE files, and I need a binary file with a base address of 0x00000000.
The GCC compiler supports this by using the command "-ffreestanding".
Is there any equivalent for Microsoft compilers or any other way using Microsoft compilers to do this?
Thank you for your attention.
Alexander M.
Don't try it, just do it!
|
|
|
|
|
You will get PE format only if you are building a win32 application, naturally you dont want win32, you want a .COM type application whose memory model will be TINY. that will not have any far calls and no .exe header,
Tried looking for tiny option in msdn but could not find it.
You can i suppose use the VC IDE and use gcc compiler to do the compilation by using custom build.
hope i helped in some way.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
thanks
Don't try it, just do it!
|
|
|
|
|
i want to get the handle of a clicked window among various opened windows;
when i click any opened window i want to ge the handle of it
Hawk,amr
|
|
|
|
|
WindowFromPoint(...) Gives you the handle of the window that was clicked.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
I have variables x&y which is manipiulated & read across some functions. Ok the pseudo code looks like -
void func1() {
enter critical section
manipulate x & y
leave critical section
}
void func2() {
read x
enter critical section
manipulate x & y
leave critical section
}
void func3() {
enter critical section
manipulate x & y
leave critical section
}
Ok the above code crashes in func2 at "read x". func1, func2 & func3 are in a multithreaded environment access
Will it be a good practice to define a new critical section for variable x or there is a simpler way to tackle this ? It shud be efficient
Dimple
|
|
|
|
|
Whats harm in reading the data also in the critical section in func2?
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
ok it is a producer consumer problem
func3 is producing something which func2 is using but before using it i need to check the value of x.
I am using critical section only as of now. How do i add this notify thing ...
Dimple
|
|
|
|
|
You should read x outside of critical section only if the operation read x is atomic, i.e. it is guaranteed by the OS or hardware, that the reading will never be interrupted.
Generally, if x is a complex data type, there isn't any suitable atomic read operation. So you should enclose read x in a critical section too. It avoids you from a conflict, when one thread reads x and another thread writes to x simultaneously (so the reading thread could read inconsistent content of x )
Robert-Antonio
It's a good luck, when you meet a real fink. Then you get a respect to
normal, mid-honest people."
|
|
|
|
|
Ok it func3 writes data & func2 reads data
If data has been written it is refelected by x (a int value) so thats the reason i read x.
Simply put i want to know how to do a conditonal wait on x
|
|
|
|
|
I think it would be ok to use mutexes to synchronize things.
You could use WaitForSingleObject(MutexName, INFINITE) before reading or writing to x, then call ReleaseMutex(MutexName) after the process.
This would synchronize things. But be sure to put then in the right place, this might cause deadlocks if misused.
Hope this help. :>
SDE
|
|
|
|
|
Hi all,
Is there any way to get the IDocHostUIHandler from the IWebBrowser2 inteface pointer.I want to disable the context menu in IE all version?.
I am using BHOs which host the Iwebbrowser interface pointer.
thanks in advance
Abhi Lahare.
|
|
|
|
|
|
I am using Flash Player component to develope an application. I am wanna to use a flash component as a background object and draw text on it. IE can implement this to support css. When I drawed text on the object, the flash object always reflashed frame by frame and the new frame content covered the text that I drawed. However, the interfaces that the flash component offers are high level functions(e.g. play, stop etc.). I can not use those interafaces to do some low level processing to control the flash drawing flow or get the drawn content.
How does IE do this? How can I implement this?
Thank you.
|
|
|
|
|
Try creating a transparent, borderless child window that appears above the flash window (in the zorder). Then draw your text in this window, rather than on the window that hosts the flash control.
onwards and upwards...
|
|
|
|
|
I am Trying to retrieve the window version in vc++
i.e whether it is win98 or winxp or win2000
but i am not getting it .plz if any idea let
me know.
If possible send a sample program
milind
|
|
|
|
|
Check out GetVersion or GetVersionEx in MSDN its fairly simple to use it.
Regards.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Hi,
This function return the Windows version,
LPTSTR CSystem::SystemVersion()<br />
{<br />
OSVERSIONINFOEX osvi;<br />
BOOL bOsVersionInfoEx;<br />
<br />
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));<br />
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);<br />
<br />
GetVersionEx ((OSVERSIONINFO *) &osvi);<br />
<br />
TCHAR tchBuffer[800]; <br />
<br />
switch (osvi.dwPlatformId)<br />
{<br />
case VER_PLATFORM_WIN32_NT:<br />
<br />
if ( osvi.dwMajorVersion <= 4 )<br />
sprintf(tchBuffer, "Microsoft Windows NT "); <br />
<br />
if ( osvi.dwMajorVersion == 5 )<br />
sprintf(tchBuffer, "Microsoft Windows 2000"); <br />
<br />
HKEY hKey;<br />
char szProductType[80];<br />
DWORD dwBufLen;<br />
<br />
RegOpenKeyEx( HKEY_LOCAL_MACHINE,<br />
"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",<br />
0, KEY_QUERY_VALUE, &hKey );<br />
RegQueryValueEx( hKey, "ProductType", NULL, NULL,<br />
(LPBYTE) szProductType, &dwBufLen);<br />
RegCloseKey( hKey );<br />
if ( lstrcmpi( "WINNT", szProductType) == 0 )<br />
strcat(tchBuffer," Workstation ");<br />
if ( lstrcmpi( "SERVERNT", szProductType) == 0 )<br />
strcat(tchBuffer," Server");<br />
<br />
<br />
break;<br />
<br />
case VER_PLATFORM_WIN32_WINDOWS:<br />
<br />
if ((osvi.dwMajorVersion > 4) || <br />
((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0)))<br />
{<br />
sprintf(tchBuffer, "Microsoft Windows 98 "); <br />
} <br />
else
sprintf(tchBuffer, "Microsoft Windows 95 "); <br />
<br />
break;<br />
<br />
case VER_PLATFORM_WIN32s:<br />
<br />
sprintf(tchBuffer, "Microsoft Win32s "); <br />
break;<br />
}<br />
<br />
return tchBuffer;<br />
<br />
<br />
}
With Regards,
R.Selvam
|
|
|
|
|
|
What is the difference between MessageBox and AfxMessageBox
when I need to use MessageBox or AfxMessageBox. What is the function or purpose between this two message.
|
|
|
|
|
humm, one difference that i can think of is AfxMessagebox can be used if the project has MFC support and MessageBox can be used in any win32 project.
They are more or less ditto in nature.
There are two messagebox one defined in CWnd and other is win32 api i.e ::MessageBox(...)
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Hello,
MessageBox declared with in Cwindow or Cwin class. Afx family functions (AfxMessageBox, AfxBeginThread, etc) are declared Global in the Microsoft Foundation Class libraries.
Both Displays the formatted message box.
Help on Message Boxes is supported through the AfxMessageBox function.
With Regards,
R.Selvam
|
|
|
|
|
The parent of message box created by CWnd::MessageBox() is the instance of window, that called the MessageBox method.
The parent of message box created by AfxMessageBox() is the main application window.
Robert-Antonio
"Life is very hard, when you apply E-R model to it."
|
|
|
|
|
HOw do i make sure that the client has received the data that i wrote on the socket before i send some other data...
i know it can be done my ack way. but the other side of the socket program does not send ack.
any way around this prob???
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
I think that there wouldn't be anyway, but to let the client acknowledge it. In case you couldn't change the client code to send back acknowledgement, the only way I count think of is read the current buffer status. This way you can at least know that it has already been retrieved. But again it might be lost. I haven't tried doing this but I saw a function called select() which identifies the status of a socket. The best way is still to let the client acknowledge it. Hope this help. :>
SDE
|
|
|
|