|
Hi Alexo,
There is nothing in it r u Missed?
anju
|
|
|
|
|
Instead of sscanf(szVal,"%X",&byByteCmd); why not use atol() ?
What I think your code is doing is that you are reading an int value (%X) into a BYTE variable and overwriting the next location(s) in memory
you could try using %c
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
BYTE byByteCmd;
....
sscanf(szVal,"%X",&byByteCmd);
And types %X and %x require int or int alike (DWORD) argument, you are using byte.
1 byte vs 4 bytes... Due to debug mode padding you don't get an error.
|
|
|
|
|
Hi,
Thanks your comments.
but,what is the relation between " CString strTemp and sscanf(...)".
If i didn't used CString object this code doesn't give me an error.
regrads
anju
anju
|
|
|
|
|
Now this must be an old problem:
I have very big project that was originally meant solely for Linux.
I now port it also to windows (on the VC++ .NET) and apparently some DLLs call each other.
So, I face a linking problem as no .lib is available (the chicken and the egg problem).
Now this is a huge project. My options, as I see them are:
1) Take off all calls to imported functions inside some DLL, build it, build all rest the same way, then start bringing in the missing calls.
2) Use some sort of dummy lib. The problem is that if such an option really exist- I don't know how to do that.
3) Collide all DLLs into one.
I'll be glad to know if option 2 really exists, or of any other option if you see such.
Dynamically loading the DLL is as bad as option 1 as it requires many changes (each DLL exports hundreds of symbols), so I prefer to stick to the implicit load, and make as little source changes as possible.
Thanx for any help.
Elad.
|
|
|
|
|
Second option does exist - do not create complicated situations .
Is there any chance of isolating dependant functions into 3rd library?
|
|
|
|
|
Not really, this whole project is one big criss-cross...
If option 2 doesn't exist I tend to throw all code in just one big DLL...
|
|
|
|
|
How about 4th option screw static linking, and load dll(s) manually.
Or even have executable static linking DLL A, and dynamic DLL B. ( I hate static linking).
Brian
|
|
|
|
|
hey guys,
I am trying to retrieve the password of a specific user with the NetUserGetInfo function. But the MSDN says the following regarding the function:
--------------------
from msdn:
link: http://msdn.microsoft.com/library/d..._info_4_str.asp
The NetUserEnum and NetUserGetInfo functions return a NULL pointer to maintain password security.
--------------------
my code:
<br />
USES_CONVERSION;<br />
<br />
wchar_t *pswzUser = T2W("A");<br />
DWORD dwLevel = 4;<br />
USER_INFO_3 pUi;<br />
<br />
nStatus = NetUserGetInfo(NULL, pswzUser, dwLevel, (LPBYTE*)&pUi);<br />
return W2T(pUi.usri3_password);<br />
So how can I retrieve the password ???
da sonu
|
|
|
|
|
My application uses a tray icon, which can open a dialog only if asked by the user.
The rest of the time my dialog in the minimized state.
How can I remove the window from the task bar while my dialog is in minimized state so the user will only see the tray icon?
And how can I remove the menu that appears with the right click on the dialog’s icon (left top corner)?
|
|
|
|
|
To remove the button from task bar you can simply hide your window by calling ShowWindow(SW_HIDE); .
|
|
|
|
|
Hi all,
I am encountering an error, while getting the value from a Combo Box. I do want to find which value the user selects from the Combo box, if not then I want to select the default value, sure the value is not selected, I am using CComboBox.GetCurSel()
Is there any way to find out which value is on top of list in the ComboBox.
Waiting for reply;
Phantom
|
|
|
|
|
To get the current selection index, use CComboBox.GetCurSel()
To get the current string selected, use CComboBox.GetLBText(index,str) with
void GetLBText( int nIndex, CString& rString ) const;
To select the first item (the one by default), use CComboBox.SetCurSel(0);
~RaGE();
|
|
|
|
|
For various annoying reasons I need to write my own installation program. This means I potentially need to install files such as mfc42.dll. If an older verison exists it will almost certainally be in use, so I won't ( ) be able to use CopyFile or CopyFileEx.
How do programs such a InstallShield copy the locked files at the next bootup when you see something along the lines of the "Please wait etc" text?
I've had a look at the RunOnce registry entiries but I'm not sure if this is what I want.
Thanks
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
|
Dominik Reichl wrote:
Q228930 - How to Replace Currently Locked Files with Inuse.exe
http://support.microsoft.com/support/kb/articles/q228/9/30.asp[^]
This works on NT and Win2k.
This looks interesting thanks, the only trouble is, I need full 95, 98, and ME compatability aswell. Hmmm, I'll see if it works.....
[Edit]small>Dominik Reichl wrote:
Deleting Locked Files
http://www.codeguru.com/files/ForceDel.shtml[^]
It's about deleting locked files, but the article explains how to unlock locked files. You unlock the files and replace with your own.
While this may work perfectly well, I'd like to find the method installshield uses. Also judging from the comments, this may not work 100% of the time. Ahh well.
Thanks
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
Have a look at this article:
http://anticrack.p15106404.pureserver.info/modules.php?op=modload&name=News&file=article&sid=3196&mode=&order=0&thold=0[^]
Various ways are described on how to delete locked/inuse files.
NT-BASED SYSTEMS
You can use the MoveFileEx method with parameter MOVEFILE_DELAY_UNTIL_REBOOT.
Win95, Win98, WinME
Use Wininit.ini and add lines like
DestinationFileName=SourceFileName
to the [rename] section. Read MSDN page on "MoveFileEx" (bottom of page) for more information.
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
|
Copy the updated files into your private setup folder
and on NT use MoveFileEx with
MOVEFILE_DELAY_UNTIL_REBOOT|MOVEFILE_REPLACE_EXISTING
or WritePrivateProfileString to add
them to the Rename section of WININIT.INI on Win 9x.
Make sure to update the SharedDLLs counts in the
registry too.
|
|
|
|
|
Brilliant, thanks!! Just what I was looking for!! I had seen the command somewhere before, but just couldn't remember it!!
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
I am trying to run a program with Borland C++ v5.02 but I get a message 'abnormal program termination' at the point where I use a 'new' operator to declare memory for a class' pointer.I found that v3.1 had problems with the 'new' operator and you needed to run a batch file to correct it.I tried that but it didn't work for v5.02.Do you know anything about that? Thank you very much for your help.
|
|
|
|
|
I am writing a machine vision application that must process 5000 frames per second from a high-speed camera. I am writing in unmanaged C with Visual C++.NET.
I have to find the bottlenecks in my code. As far as I can tell from the VS.NET documentation, the only performance analysis tools that ship with VS.NET are for profiling distributed web applications and are not suitable for fine-grained source-profiling of unmanaged code.
Is there any way to profile the source code with Visual Studio.NET or do I have to slip back to Visual Studio 6.0?
Why couldn't Science, in the long run, serve
As well as one's uncleared lunch-table or
Mme X en Culottes de Matador? James Merrill
|
|
|
|
|
http://nprof.sourceforge.net/[^] or the .NET profiler at Numega that is free .
Cheers,Joao Vaz
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary.-Shog9
Remember just because a good thing comes to an end, doesn't mean that the next one can't be better.-Chris Meech
|
|
|
|
|
Thanks, but as I wrote, my application does not use .NET. It's a native, unmanaged executable. All I seem to find are .NET profilers when what I want is something to profile native code.
|
|
|
|
|
http://www.compuware.com/products/devpartner/profiler/[^]
The numega free community edition profiler suports profiling native vc++ , check the link to download it
Cheers,Joao Vaz
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary.-Shog9
Remember just because a good thing comes to an end, doesn't mean that the next one can't be better.-Chris Meech
|
|
|
|