|
Hi,
i checked them both from MSDN library i found two commands _mkdir and _rmdir but i need more than that. i need to know how can i create dates 14112002 format. 15,16,17 .. and deleting 13,12,11...
Do not understand the movefile function as well.
i need to write all in basic c++ format will do.
Thks for your advice.
|
|
|
|
|
Look up _strdate and fwrite.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
Hello all,
I've done a service that sets a system wide keyboard hook, in order to be able to do this, I've done a DLL that installs a system wide hook in order to avoid the continuity of some keystrokes (alt+tab...).
The only problem is that there where some keystrokes that were not handled in that old version of that NTService + DLL... I need to handle those keystrokes that I missed before, but now I don't remember all the steps that I followed when I linked that DLL...
Now, after making the desired changes, when I try to build the DLL I get this compiler message:
--------------------------------------------------
Deleting intermediate files and output files for project 'SCT - Win32 Release'.
Deleting intermediate files and output files for project 'DLLSCT - Win32 Release'.
--------------------Configuration: SCT - Win32 Release--------------------
Generating Message Catalogue
MC: Compiling NTServiceEventLogMsg.mc
Writing .\MSG00000.bin
[00000003 .. 00000003] - 12 bytes
[40000000 .. 40000000] - 12 bytes
[80000001 .. 80000001] - 12 bytes
[c0000002 .. c0000002] - 12 bytes
Total of 4 messages, 100 bytes
Compiling resources...
Compiling...
DeshabilitarCtrlAltDel.cpp
main.cpp
NTService.cpp
SCT.cpp
Linking...
LINK : fatal error LNK1181: cannot open input file "..\DLLSCT\release\DLLSCT.lib"
Error executing link.exe.
DLLSCT.dll - 1 error(s), 0 warning(s)
--------------------------------------------------
I don't understand how should I have the .lib file in that folder if the compiler deletes all the files that are there, and moreover, I don't understand why there should be a lib file if the DLL is being created and the lib file is created by the compiler (if I remember it right... )
could you give me a piece of advice?
Thank you in advance
|
|
|
|
|
In your project settings are you pointing to \release\DLLSCT.lib? Maybe you need to change the link path.. Under project > Settings > (Link Tab)..
Just a guess..
|
|
|
|
|
I have an application that loads dlls which manipulate the applications document data by creating data within it.
However when my application deletes this data, it throws an exception because the some of the data it has was allocated from a different heap (the dll's).
Q. Is it possible to have a global heap available to both application and dll, where the app creates the document in the global heap, and the dll's can create data within it, which can then be destroyed by the application?
If so - how?
I recognise this could be a "bad" technique - (as a DLL may reference memory that has been deleted by the application) but my DLL's will only ever create data within the document, they will never re-reference data they have created.
Any suggestions?
|
|
|
|
|
makom42 wrote:
Is it possible to have a global heap available to both application and dll
You could use GlobalAlloc() /GlobalFree() , but this is basically Windows3.0 stuff.
MSDN suggests to use HeapCreate() /HeapAlloc() /HeapFree() .
It states specifically that the private heap that a DLL creates is only visible to this dll and the main process. If you can live with that, fine.
There may be better possibilities, but this one is one that works (if maybe a bit of a 'brute force' approach.
|
|
|
|
|
Nope - a heap private to the DLL is of no use at all.
Basically - I'm exposing the app's data structures to external dll's and allowing them to use methods within my objects to add data to the app's data.
But because the dll allocates the memory from it's own heap when the method is called, only that dll can unallocate the memory.
I need the DLL's to "create and forget", and allow the app itself to clean up all the data.
If this is not possible, then how would plugins for other apps (such as 3DS Max, Milkshape) create data within the app's heap and yet still allow the app to deallocated it?
|
|
|
|
|
makom42 wrote:
Nope - a heap private to the DLL is of no use at all.
I dont think so - a dll has no own heap, it sits in the loading processes adress space.
The heap obtained by HeapCreate is private to the *process* that has loaded the dll.
Look at the MSDN[^] entry for 'HeapCreate'!
It seems that this is exactly what you want: process-wide storage space of any size - you only need to pass the HANDLE around .
But I admit that I am no expert with dlls, trying to link statically wherever possible.
|
|
|
|
|
Hmm... okay - thanks for pointing that out - I'll have a looksee... cheers
|
|
|
|
|
jhwurmbach wrote:
it sits in the loading processes adress space.
okay - if this is the case, and the dll does not allocate memory from it's own heap, but allocates from the process heap, then why can't the process deallocated the memory?
As for HeapCreate - you may be right, and this would mean my going through and removing all of my new operators... it does make sense - but I don't see why the new operator doesn't behave in this manner anyway. Oh well.
|
|
|
|
|
makom42 wrote:
removing all of my new operators
Weeeellll...
You could overload the operator new() , but this would the be a little over the top I think.
|
|
|
|
|
|
|
As I understand it, heaps in WIN32 are particular to the process.
There is no global heap across applications for data (such as
there was in Windows 3.1), nor heaps specific to code sections.
There is only the one default heap and any dynamic heaps created
with HeapCreate. If your application calls a function in a loaded
DLL that creates a heap, it belongs to the process. (it will
show up in the handles returned by GetProcessHeaps)
If the DLL function allocates memory using, for instance, GlobalAlloc
or LocalAlloc (same thing in WIN32), it is allocated on the process's
default heap and may be used or freed anywhere in that process.
So I think the exception you mentioned is not thrown because of the
section of code in which it was allocated, but some other reason--
maybe it was freed elsewhere. Maybe the handle or pointer was changed
on you and you are accessing an invalid address.
Short: what you are trying to do is perfectly ok. It's just got a bug
someplace.
|
|
|
|
|
Daft as this may sound, I hope this is the case...
|
|
|
|
|
No idea why this replied as anonymous - seeing as I have logged in... but there you go...
makom42...
|
|
|
|
|
Hello,
I'm trying to resize my Property sheets, and I've almost done it, but I still have one little problem, when I resize the TabCtrl I must be able to know how many lines of tabs will it occupy after the resizing action.
Is there any way to know this?
NOTE:
If after the resizing action the TabCtrl has more than one line of tabs, then I can't see the tabs properly, but when I change of tab (pressing Ctrl + tab or with the mouse) the tab control gets resized in the right way.
Tahnk you in advance.
|
|
|
|
|
You should be able to use CTabCtrl::GetRowCount() to get the number of rows in that the tab ctrl is using, and then use CTabCtrl::GetItemRect() to get the height of a particular tab. Using these values, you should be able to calculate the overall tabctrl's height (and width).
Chris
"No one goes to hell because of their sin, but because of rejecting God's method of salvation: His Son's life for yours..."
"It does not take a majority to prevail ... but rather an irate, tireless minority, keen on setting brushfires of freedom in the minds of men." --Samuel Adams
|
|
|
|
|
Hi,
I have a small query.
I want to attach another dialog to the bottom of the a dialog.I shouldn't be able to move the bottom dialog.It should look like there is only one dialog.Also if i resize the bottom dialog top dialog should also be resized.
How can i achieve this?
Regards
Neha
|
|
|
|
|
If you can't move it, why do you want two dialogs ? You could handle WM_MOVE in one and move the other, and make the bottom one frameless, but it will always be a hack. If you explain why you want to do this, perhaps I can give better advice.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Why i needed 2 dialog boxes was my application is a custom dialog app.I need to paint Non-client area(border,caption etc..).
||------------|| ------>CAPTION
||------------|| -----> PART 1
|| ||
|| ||
----------------
|| ||
|| || ------> PART 2
||------------||
Bitmaps disaplyed as a border for part 1 & 2 are different.So i thought of using diff dialog boxes.
Any idea,how can i achieve this?
Regards
Neha
|
|
|
|
|
I would have thought if you're drawing them yourself you can just draw the two different parts ? It would be a lot simpler.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
You can do that easily with property pages
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Could you please tell me how?
Thanks
Neha
|
|
|
|
|
It's pretty straightforward. Create a new dialog as a property page type, give it a class (as you would with any normal dialog)
then in the main dialog, do something like this
m_pxSubDialog = new CSubDialog( this );
m_pxSubDialog->SetAnyOptionsEtc();
m_pxSubDialog->Create( IDD_DIALOG_RESOURCE_NAME, this );
m_pxSubDialog->SetWindowPos( ... );
m_pxSubDialog->ShowWindow( SW_SHOW );
(where m_pxSubDialog is a member of the main dialog class, of the type of your new sub dialog, and IDD_DIALOG_RESOURCE_NAME is the name of the dialog in the resource editor.)
To close the sub dialog from the main dialog, use
m_pxSubDialog->DestroyWindow();
delete m_pxSubDialog;
m_pxSubDialog = NULL;
To make your sub dialog communicate with the main one, you can pass messages back from the child to the parent window
--
Help me! I'm turning into a grapefruit!
|
|
|
|