|
Me think coding the compiler is the least of your problem.
anyway, read this, it's essential reading for anyone who want to write compiler. :
Principles of Compiler Design[^]Watched code never compiles.
|
|
|
|
|
Hi,
Kindly read the guidelines[^].
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi,all.
I got a serious problem when doing ownerdraw listview with a fixed position background image in win32.
In my code, i try to use ListView_SetBkImage, but unlucky, the image itself will also scroll with scrollbar.
I also try to draw a image in NM_CUSTOMERDRAW, this can't work either, the background paints wrong.
do someone know how to solve this problem or provide some good solution?
thanks all very much for your's great help.I'm a fish
|
|
|
|
|
Please provide a reaction for WM_ERASEBKGND
and draw your image there... virtual void BeHappy() = 0;
|
|
|
|
|
Dear Eugen:
thanks very much for your greate help,but it will flick,now i find a better solution
first i subclass my listview and handle LVM_SCROLL message with a invalidate action,it works better.
by the way, i draw the background in CUSTOMDRAW function.
thanks again.I'm a fish
|
|
|
|
|
Hi!
So I have posted this question a while back but has some additional information since I am still stuck on this problem. Here is what is supposed to happen on a server:
1) SQL Server receives request from a client
2) SQL Extended procedure launches DLL
3) Launcher DLL launches Server EXE
4) Server EXE executes Server DLL attached to it to process command
Now testing this on my environment (Windows XP Service Pack 3, Core 2 DUO @2.33GHz, 2GB of RAM) and another test server (Windows Server 2003 R2 Service Pack 2, Xeon CPU @3.0GHz, 3GB of RAM) by triggering the request event (from #1) 2x simultaneously works. The request is being handled in parallel by the server. I can see that there are different instances of Server EXE (#3) being created per request.
The problem is with another server environment that we have (Windows Server 2003 R2 Service Pack 2, Xeon CPU @2.5GHz, 3GB of RAM). No matter what happens, there is always 1 Server EXE being created (checked this through Process Explorer by Sysinternals) and for the next requests received, the machine just adds a new thread on the same existing Server EXE process (checked this through logs, GetCurrentProcessId and GetCurrentThreadId APIs). This is a problem, since there is only 1 Server EXE, that means that all threads are also sharing the attached Server DLL to it. Making the requests being processed sequentially instead of in parallel.
I have read about this and it seems to be a multi-tenant behavior on the machine but I don't know why the machine behaves that way. Anyone has any idea/clue on this problem? I'm on a dead-end right now. Thanks!
Note:
As an additional information, in Launcher DLL (in #3), here is an overview of the code being executed when called:
<br />
HRESULT hr = ::CoInitialize(NULL);
.<br />
.<br />
ServerEXEPtr ptrServerEXE;
hr = ptrServerEXE.CreateInstance(__uuidof(ServerEXEPtr));
.<br />
.<br />
ptrServerEXE->ExecuteServerCommand(param);
ptrServerEXE.Release();<br />
.<br />
.<br />
::CoUninitialize();<br />
|
|
|
|
|
Please compare the registries of the server on the both machines virtual void BeHappy() = 0;
|
|
|
|
|
Hi Eugen!
Thanks for your reply. I am currently comparing both the register of both machines, and the difference is really big right now (used compare tool on the saved registry settings). Might I know what specific settings should I look for or compare? Thanks again!
|
|
|
|
|
It could be something like "singleton"
or ..\CLSID\{..}\SingleUse
Can you find any usage of DECLARE_CLASSFACTORY_SINGLETON
in your servers code ?virtual void BeHappy() = 0;
|
|
|
|
|
Hi Eugen,
I have checked the registry and as with the Singleton or SingleUse, there is none. I also checked the code and there is also none of DECLARE_CLASSFACTORY_SINGLETON.
The thing is, the code works on other environment except for this one machine that we have. I am checking the way the thread in the application is being created. Seems to have something to do with CoInitialize on whether the application should be as an apartment thread or multithread. Anyway I'm gonna follow that lead first..
Thank you for your help!
|
|
|
|
|
OK
Please compare also:
Start -> DCOMCNFG -> Componen Services (?) ->
Computer -> Workstation -> ContextMenu ->
Properties(Settings?) -> COM Security & Other pages there.
Try also to unregister
and then to register the server in its actual directory again,
and the CoInitializeEx(..) too virtual void BeHappy() = 0;
modified on Tuesday, March 16, 2010 10:26 AM
|
|
|
|
|
Eugen Podsypalnikov wrote: Please compare also:
Start -> DCOMCNFG -> Componen Services (?) ->
Computer -> Workstation -> ContextMenu ->
Properties(Settings?) -> COM Security & Other pages there.
This absolutely worked! Someone on the server made some settings on the specific application properties -> identity tab that a specific user's account will be used to launch the application instead of the launching user. Thank you very much!
|
|
|
|
|
Hi,
Im having the frame duration.Can we find frame rate by using this duration?
|
|
|
|
|
rate = 1.0/duration.
That's it, isn't it?
Iain.I have now moved to Sweden for love (awwww).
|
|
|
|
|
yep.. be care to use the same units of time. say if the frame duration is 100 milliseconds, then frame rate (per second) -> 1000 /100 = 10
|
|
|
|
|
Well, my answer was accurate...
1/100ms = 1/(0.1s) = 10 (per/s) = 10Hz.
But you're right, he will have to be careful about units!
Iain.I have now moved to Sweden for love (awwww).
|
|
|
|
|
Hi all,
I am trying to get a value from registry.but it gives 234 error code.That value will contain only a few digits. I have allocated size of 1000. But it is giving the same error code.Can anyone please help me?
Here is the code:
HKEY hkey1,hkey2;
DWORD dwData = REG_SZ;
DWORD dwSize;
char szChk[102];
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Test",0, KEY_QUERY_VALUE,&hkey1))
return;
if(RegQueryValueEx(hkey1,"CHECK",NULL, &dwData, (LPBYTE)szCHK,&dwSize))
return;
Thanks,
|
|
|
|
|
The dwSize is an in_out parameter, meaning you have to specify the initial size of the buffer and the function after executing will return the actual size of the data.
So do this -
DWORD dwSize = 102;
|
|
|
|
|
no... its not working... again it is giving same error code
|
|
|
|
|
Please see an example[^] here
Do not forget to release the memory in that example
(free(PerfData) at the ending of the main() ).virtual void BeHappy() = 0;
|
|
|
|
|
Try to init your size-variable :
char szChk[102];
DWORD dwSize(sizeof(szChk)); virtual void BeHappy() = 0;
|
|
|
|
|
On closer inspection of your code, RegOpenKeyEx return ERROR_SUCCESS if successful.
The value of ERROR_SUCCESS is 0 .
This means RegOpenKeyEx in your code has failed.
Change your if statement to check if the return value is ERROR_SUCCESS .
Please read the documentation on what each function returns.
|
|
|
|
|
Karthika85 wrote: I am trying to get a value from registry.but it gives 234 error code.
It's not necessarily an error. RegQueryValueEx() can return ERROR_MORE_DATA . Read the docs to find out when and why this happens."One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I reference this Using the Windows 2000/XP Object Selection Dialog[^]. It's great article, but what i need is to get specified user list or group, such as "administrators" group, and all users in this groups, what should i set with the filter?
Say:
1. "administrators" group
2. users in "administrators" group
3. "users" group
4. users in "users" group
In a word, my purpose is to get only 1&&2&&3&&4, NOT all the users and groups in local PC, what should i do set with the filter?One day a pretty girl asked me:"Do u think you are handsome?" "I don't think so!".She gave a slap in my face:"Why lying?"...
|
|
|
|
|
i am not clearing with your question.
are you want current user or all details of user.
|
|
|
|