|
I don't believe there is a way to programatically to do that besides taking the case off of the computer and examining the drive. Maybe, the manufacturer's utility (e.g. Western Digital or MaxStor) can get that info if it is indeed stored on the disk.
|
|
|
|
|
Hi Friends
The other day I tried to create a class which creates a timer and
its associated procedure.The skeleton class code is like this:
// CTIMER.H
class CTIMER
{
public:
void CALLBACK myproc(HWND,UINT,UINT,DWORD);
int Create();
CTIMER();
virtual ~CTIMER();
int Timer_ID;
};
//CTIMER.CPP
//Other code
//This code is creating problem
int CTIMER::Create()
{
//the (TIMERPROC) cast seems the source of bug
Timer_ID=SetTimer(NULL,0,500,(TIMERPROC)myproc);
return 0;
}
The above code is not compiling but gives an error C2440 along with a
message "None of the functions with this name in scope match the target type"
Whe I declared the function outside the class ,everything is OK.How can I solve this problem.Im new to C++ style programming,My experience is with C style Windows SDK coding.OS Win98/NT4,MSVC++6
|
|
|
|
|
a timer callback (or most any CALLBACK) can't be a non-static member function of a class. either make the function a static function (which can't access class data, and therefore might as well be outside the class), or just use a non-class function.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Hi,
I'm dealing with an html page that has 12 tables in it. I'm trying to get to a particular table row which has a class="row1" but it doesn't look like the IHTMLTableRowPtr contains any method for retrieving the class name.
Can anyone give me any input as to if this is possible?
Thanks in advance,
Craig
|
|
|
|
|
Hi !
I am trying to find a way to reuse dialogs I already desined in other projects and import them to my new project, I can't find a way to do that. I tried to mess with the *.rc file but it did not work.
Thank you
|
|
|
|
|
One way is to have the project you want the dialog to be imported into open and then open the .rc file that contains the dialog that you want to copy from. That will open in the code window, just navigate to the dialog and copy it to your open project.
Hope this helps,
Craig
|
|
|
|
|
open the .RC file from the old project in the new project. then you can just copy/paste the dialog resources into the new project.
you'll have to copy the actual .cpp and .h files by-hand
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Hi all,
My OCX is having some issues...
When minimizing my app, or clicking on another app and coming back, some list controls aren't being refreshed and "disappear". The info. is still there, but you can't see it unless you click on it.
Do you know of a function that is called when loading AND restoring the dialog after setting focus to another application? That way, maybe I can call Dialog::RedrawWindow() everytime I come back to the app?
Thank you for your help!
Graham
|
|
|
|
|
I have an ActiveX control that I wrote a while ago. It compiled fine then, but when I accidently hit "Rebuild All" today, I got the following output:
<br />
--------------------Configuration: PilotImport - Win32 Debug--------------------<br />
Creating Type Library...<br />
Processing C:\My Projects\Completed Components\PilotImport\PilotImport.odl<br />
PilotImport.odl<br />
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl<br />
oaidl.idl<br />
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl<br />
objidl.idl<br />
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl<br />
unknwn.idl<br />
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl<br />
wtypes.idl<br />
Compiling resources...<br />
Compiling...<br />
StdAfx.cpp<br />
Compiling...<br />
Pilot_Import.c<br />
PilotImport.cpp<br />
PilotImportCtl.cpp<br />
PilotImportPpg.cpp<br />
Linking...<br />
mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)<br />
mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj); second definition ignored<br />
Creating library Debug/PilotImport.lib and object Debug/PilotImport.exp<br />
Debug/PilotImport.ocx : fatal error LNK1169: one or more multiply defined symbols found<br />
Error executing link.exe.<br />
<br />
PilotImport.ocx - 2 error(s), 1 warning(s)<br />
<br />
Nothing in the code has changed -- does anyone know why this linker error suddenly popped up? I got around this with another project by completely remaking the project, but this requires a lot of retyping.
Thanks
Zac
"If I create everything new, why would I want to delete anything?"
|
|
|
|
|
Nevermind, I found out why it is doing this. As it turns out, this is caused by the CRT being linked before MFC (I still don't understand how it gets in a state where this occurs since nothing had changed in the code, but oh well). The solution is in a knowledge base article:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q148652&
"If I create everything new, why would I want to delete anything?"
|
|
|
|
|
1- Why doesn't pop() return a reference to the pop() ed object?
It is a pain to always do a top() to get the reference then pop() to remove it. Anyway, I made my own wrapper:
namespace mystd{
template<class T, class Container = std::deque<T> >
class stack : public std::stack<T, Container> {
public:
stack() : std::stack<T, Container>() {}
explicit stack(const container_type& _Cont) : std::stack<T, Container>(_Cont) {}
virtual ~stack() {}
T& pop() {
T& t = top();
std::stack<T, Container>::pop();
return t;
}
};
}
What do you think of it? Any comment?
2- When you call top() on an empty stack, what happens? The reason I ask this question is because in my wrapper class' pop() method I call top() , then pop() . Is that a problem?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Michel Prévost wrote:
When you call top() on an empty stack, what happens?
You're entering the land of 'undefined behavior'. Which means you can expect anything. STL implementations with debug checks (STLPort) will probably assert at you.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
1 - A old question
Check http://www.sgi.com/tech/stl/stack.html[^] at the end of the page the [3] marks the spot
2- Simple, undefined behaviour , the pre-condition to call top() is the method empty() to be false , so you should always call empty() first, and if it returns false(), the you can safely call top()
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
|
|
|
|
|
Hello All,
Ive finally entered the world of VS.NET. I love the new IDE, but. I work in the UNIX environment a lot, Im a VI guy, but I like the VS.NET IDE better. I have been editing some C files that I am also loading into VI and Ive noticed that there are speecial characters in the file Specifically TABS and carriage returns marked with ^M.
This didnt happen in VC++ 6.0 is there an editor option I can turn off. I just want plain text editing..
Thank you..
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
|
jparsons wrote:
Is there any message that is sent when a Tree Control collapses a node? If not then how can I tell when a node has been collapsed?
WM_NOTIFY/TVN_ITEMEXPANDED is sent when a node has expanded or collapsed!
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
jparsons wrote:
Shouldn't be hard to figure out which one is which
The action member of the NMTREEVIEW is TVE_EXPAND when it is expanded and TVE_COLLAPSE if it has collapsed.
jparsons wrote:
Would it have been that much trouble to add a TVN_ITEMCOLLAPSED message?
Think about UpdateData(true/false). They could have easily added a UpdateControls(...) but they didn't
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
hey ...
I would like to call Find for Files and Folders present in Windows when u click start button thru VC or VB code? can anybody plz tell me how to do that?
--thnx.
|
|
|
|
|
use this function,
bool LocalInterface::DisplayDir(CListCtrl& list, LPSTR lpszdirname)
{
// instantiate a CFindFind object
CFileFind tempFind;
char tempFileFind[200];
sprintf(tempFileFind,"%s\\*.*",lpszdirname);
// check whether there is file existing in the
// current directory
BOOL IsFinded=(BOOL)tempFind.FindFile(tempFileFind);
int nItem = 0;
char lpBuffer[80];
GetCurrentDirectory(80, lpBuffer);
int length = strlen((LPCTSTR) lpBuffer);
// insert a return picture in first line
if(length>3)
{
list.InsertItem(nItem, "..",2);
nItem++;
}
// if file exists in directory, get files and directory
// in the directory show them in the list
while(IsFinded)
{
IsFinded=(BOOL)tempFind.FindNextFile();
// check whether it is '.' or '..'
// if not, then get this file or directory
if(!tempFind.IsDots())
{
char foundFileName[200];
strcpy(foundFileName,tempFind.GetFileName().GetBuffer(200));
// if it is directoy
if(tempFind.IsDirectory())
{
// TRACE("\ndir = %s\n", DirList);
list.InsertItem(nItem, foundFileName,1);
list.SetItemText(nItem, 2, "0");
list.SetItemText(nItem, 3, "dir");
}
// if it is a file
else
{
CString filesize;
DWORD n = tempFind.GetLength();
filesize.Format("%d",n);
list.InsertItem(nItem, foundFileName,0);
list.SetItemText(nItem, 2, filesize);
list.SetItemText(nItem, 3, "file");
}
// get create time of file
FILETIME filetime;
tempFind.GetCreationTime(&filetime);
CString strfiletime = GetFileTime(filetime);
list.SetItemText(nItem,1,strfiletime);
nItem++;
}
}
return true;
}
|
|
|
|
|
sir ,
thnx for the code...but plz do tell me how to execute that??? i dont want to create my own find....I just want to call the Search present in Windows.
but now u have created the code...thnx for that...plz tell me how to execute that??
--thnx
bye
|
|
|
|
|
Maybe that question seems a bit odd but I've got the MS VRML viewer on a machine and not on the other. So I was wondering how it was distributed.
I'm looking for MS VRML Viewer download area and Interface specifications somewhere on the MS site but can't find any info.
Is the ActiveX control still available separately or has it been included in IE ? Has it been abandonned ?
I'm looking for infos on an HTML compatible VRML viewer that I could use for a professional project. Every link of tips would be appreciated.
Thank you
Yarp
|
|
|
|
|
Does anyone know if there are any wrapper classes around for using dialogs without MFC. I'm not looking for a full CDialog replacement, but something which encapsulates the WndProc etc.
Cheers
James
|
|
|
|
|
have you looked at WTL ?
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
No I don't want to be reliant on a library. My code is plain WIN32 but in C++ and so I want to code my dialogs in the same way.
Cheers anyway.
|
|
|
|