|
I wanna know ways to make low-level operations to devices (mainly the hard disk) in .Net Framework by using C++ dll's or something ?????
By ways I mean maybe a class or a Windows standard API library (doesnt matter if its not managed code)
Specific things I want to know are (mostly consultations) :
- the beginning/ending number of cluster and track of files,
- the beginning/ending number of cluster and track of folders
- the size in clusters of files
- the volume serial number
- the size in clusters and tracks of a hard disk, etc
- can I do "interrupts" ???
Let me know the class or the Api library and the documentation, if there is it.
thanks in advance, fvalerin
|
|
|
|
|
It sounds like a device driver is in your future.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Well, no, I dont want to complicate my existence. I just want to read those kind of values
thanks, fvalerin
|
|
|
|
|
I know of no way to circumvent the HAL in order to get access to such low-level information.
For the fourth bullet, use GetVolumeInformation() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I just saw this article:
Hooking the kernel directly
http://www.codeproject.com/useritems/soviet_direct_hooking.asp
maybe he can help you !
Marcello
|
|
|
|
|
Marcello wrote: maybe he can help you !
I'm not the one needing help, fvalerin was.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes, I meant fvalerin
|
|
|
|
|
is there any way to change the default color(blue) of title bar, and the color of text in a dialog application.
Thanks
|
|
|
|
|
i think only way is to draw them yourself on WM_NCPAINT message.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
|
Hello,
I have a weird error that I hope someone can help me with:
I have a program (SDI), whose view is derived from CPropertyView, a property sheet view by Leo Moll. When I run the application in debug mode, I have no problems whatsoever. However, if I change to release mode, I get the following:
depView.obj : error LNK2001: unresolved external symbol "protected: int __thiscall CDepView::OnCreate(struct tagCREATESTRUCTA *)" (?OnCreate@CDepView@@IAEHPAUtagCREATESTRUCTA@@@Z)
Release/dep.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
dep.exe - 2 error(s), 0 warning(s)
In DepView.h, I have:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
In DepView.cpp, I have
BEGIN_MESSAGE_MAP(CDepView, CPropertyView)
ON_WM_CREATE()
...
END_MESSAGE_MAP()
and
int CDepView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
return 0;
}
If I remove either the declaration in the header file, or the implementation (and message map) in the source file, it compiles fine, but crashes when I close it (and of course doesnt initialize anything).
Does this sound familiar to anyone?
I have only seen this error when I forget to include the source file in the project, but I have checked that. What boggles my mind is that it works perfectly in debug mode.
Any help/comments would be greatly appreciated,
Thanks in advanced,
-----------------
Genaro
|
|
|
|
|
Just a guess: I'd check the preprocessor definitions for the release build and compare it to that of the debug build. In particular I'd pay attention to the UNICODE , _UNICODE and _MBCS defines.
Steve
|
|
|
|
|
Hi Stephen,
thanks for the reply. I checked the preprocessor settings, and as far as definitions are concerned, no difference, except for _debug vs. ndebug.
For project options,
Debug is:
/nologo /MDd /W3 /Gm /GX /ZI /Od /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "_DEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/Fp"Debug/dep tool.pch"
/Yu"stdafx.h"
/Fo"Debug/"
/Fd"Debug/"
/FD /GZ /c
Release is:
/nologo /MD /W3 /GX /O2 /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "NDEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/FR"Release/"
/Fp"Release/dep tool.pch"
/Yu"stdafx.h"
/Fo"Release/"
/Fd"Release/"
/FD /c
I can't find anything that would cause the error there... any clues?
-----------------
Genaro
|
|
|
|
|
Looks fine. I can't think of anymore suggestions. Good luck
Steve
|
|
|
|
|
I see at least five differences, which may or may not be the problem. Change the "Relase" values to match the "Debug" values and see if that makes a difference.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thank you for you response,
I just figured it out a while ago. All I had to do was change the first line of the release options to match the debug options, and it worked.
Thanks a lot,
-----------------
Genaro
|
|
|
|
|
I have program that support only DLL, i want to send msg from it to MSMQ,
so what is the best things that i can do ? can i call function in DLL that have Code to send msg for MSMQ ? if not, then what to do ?
Ali
|
|
|
|
|
Hi
I am trying to understand when sender is useful.In what circumstances i need this?
I have a sample code :
<br />
void __fastcall TForm1::Button1Click(TObect *Sender) <br />
{ <br />
TButton *Button = dynamic_cast<TButton *>(Sender); <br />
if (Button) <br />
{ <br />
} <br />
else <br />
{ <br />
} <br />
} <br />
here it writes :
// do something when a call was made
// passing a NULL value for *Sender)
How can it possible?I mean what type of code passing NULL value for *Sender.I am confused.
Please help me to understand the functionality of sender.
Thanks.
|
|
|
|
|
The sender is a pointer to the object that raised the message ( so, it iwll be the button that was clicked ). I can't imagine why it would be called with NULL.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I use bitmap on my dialog.
Also i use CtlColor function to create transparent static text.
The main problem is that my menu still has the same color.
How to create transparent menu for bitmap Dialog?
|
|
|
|
|
no such menu.
but u can draw or use some controls (i.e. static) to simulate "menu bar", when user clicks them, u popup sub-menu by TrackPopupMenu() function.
-- download last software in my signiture to see its performances.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
I have a little problem:
I use ado to connect to a mysql database (version 4.0.12) and mysql odbc driver(3.51).
The system works fine but recently i ran into this problem:
I've installed it on a LAN consisting of 5 win98SE stations making one of them the database server.
The program works on two of them quite ok but fails on the other 3. The thing is that the other 3 computers still connect to the db but some of the querys fail.
Actually is not the querys that fail but rather the call to _RecordsetPtr->GetCollect("field")
To be more precise a query like "SELECT id, name, address FROM clients" works.
A query like "SELECT clients.id AS id, clients.name AS name, ocupations.kind AS kind FROM clients AS clients, ocupations AS ocupations WHERE clients.ocupationid = ocupations.id" fails when i do a call to pRecordSet->GetCollect(L"kind") with invalid pointer.
Another thing to remember is that the database server is installed on one of the computers that do not work. The stations on which the program works connect to this computer via LAN
So, what do i do? Where should i search for the bug? I really have no ideea.
I never had this problem on winxp and this program works on several win88se networks
|
|
|
|
|
It fails only on the Db server machine? If it is so, one thought is, try to change the recordset CursorLocation.
ConPtr->CursorLocation = ADODB::adUseClient
Or
ConPtr->CursorLocation = ADODB::adUseServer
Try both options. This code is applicable only if you are using ADO. I guess you are using ado as _RecordsetPtr->GetCollect() is an ADO smart pointer.
rgds...mil10
|
|
|
|
|
i don't think that this is the problem. The app fails also on some of the clients. I've mentioned that it fails on the server to show that it is not a LAN problem.
Anyways, my XP station connects to that server and runs just fine but even if i set this station to be the server, the win98se one won't work
|
|
|
|
|
I really do not know what caused this problem but installing the latest MDAC from microsoft solved it It's strange but i remember having a problem that crealy pointed to a data access problem. I fixed it then by installing MDAC 2.8 but it didn't work this time. What fixed it was MDAC 2.8 sp1...
|
|
|
|