|
akayoku wrote:
I have tried to find a suitable stdafx.h file, but there are too many on the web and in the help directory of VC, all are different and I dont know which to use.
OK - you can't just rip files from other projects willy nilly and insert them, especially stdafx.h, as it will differ from project to project.
akayoku wrote:
I do not understand what you said about windows or console and framework
I'm not being rude, but you're writing security code but you're experience is such that you don't know what a console application is ? A console app is one that brings up a console window ( one with just text in it ). A windows app has a window. You need to abandon this until you have a better idea of some basics, or you risk never learning them.
akayoku wrote:
But, then I understand I should not import other's codes. I am trying to learn from the code and see what I can do.
If you were to look inside the registry classes you've got, then you should see the code you need in order to read and write the registry.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
At this point it would be better if you started over. Use AppWizard (Ctrl+N) to create a new application. A Win32 Console Application would probably be best to start with. On the "Step 1 of 1" box, select the second radio button (you don't need to mess with MFC right now). Now in the main() function, you can access the registry using RegOpenKeyEx() and RegQueryValueEx() . Use printf() to print out the results. See if you can get this working and then we can help you build upon it.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
akayoku wrote:
But, the error still exists.
you can also Use CRegKey Class defined in ATLBASE.h
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
But, I do not have ATLBASE.h
Where can I have it?
|
|
|
|
|
What version of the compiler are you using ? You probably should have it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am using VC++ 6.0
Yes, I can find the atlbase.h , but after inserting it as the header file, it always keeps saying that :
fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory<br />
Error executing cl.exe.
Sigh.... wondering Landy
|
|
|
|
|
Again, the basic problem is that you're trying to walk before you can crawl. I recommend buying a book on basic C++, and also doing a range of simpler projects before trying to write anything so complex as to access the registry.
In order to use a header that's not in your project directory, you need to set the include paths for either the IDE ( so it always works ) or for the one project, to point to the folder where the file is. Or you need to specify the full path to the file in your #include statement.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes, really, I am trying my best to walk before I learn to crawl. My professor only gave me a month to study it and now working hard on this project. I have read some basic things in fundamental references.
Anyway, when the program stated that it can't find the header file in the directory, I find the header file for it... I have tried to find out all the header files it needs, however, after all, other kinds of errors pop up finally like: syntax error, or undeclared identifier, etc...
~~~ Landy
|
|
|
|
|
akayoku wrote:
te :47 24 Jun '05
Yes, really, I am trying my best to walk before I learn to crawl.
Can't be done.
akayoku wrote:
My professor only gave me a month to study it and now working hard on this project.
Then your professor is not being fair. Complain.
akayoku wrote:
I have tried to find out all the header files it needs, however, after all, other kinds of errors pop up finally like: syntax error, or undeclared identifier, etc...
When you include a header, it can include more. That's one reason you can't just use any stdafx.h. I'm with David, it sounds like you've made enough of a mess that the only way forward is to create a new project and start again.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how are you including the atlbase.h file :
#include "atlbase.h"
or
#include<atlbase.h>
anyway, second one in correct
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I have tried both.
When I tried the first one, it would turn out many errors like syntax errors, undeclared identifier, etc...
When I tried the second one, it still states that atlbase.h is still missing in the directory.
~~~ Landy
|
|
|
|
|
akayoku wrote:
When I tried the first one, it would turn out many errors like syntax errors, undeclared identifier, etc...
Check Is you find the ATLBASE.h at this location
DRIVE NAME:\Microsoft Visual Studio\VC98\ATL\Include
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
now include you ATLBASE.h using absolute path i.e.
#include " DRIVE NAME:\Microsoft Visual Studio\VC98\ATL\Include\atlbase.h"
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I have tried it, but:
fatal error C1083: Cannot open include file: 'C:\Microsoft Visual Studio\VC98\ATL\Include\atlbase.h': No such file or directory<br />
Error executing cl.exe.
I have also tried to copy the file into the same directory as the program, then it started to ask for another header file called "atldef.h"...
After I added "atldef.h", then it asked for another, and then another....
In the program, if I type #include <atlbase.h> , it just treats it as absent; if I type #include "atlbase.h" , then it would ask for other header files.
After copying all header files it needs, finally it pops up other general errors: syntax or undeclared stuff....
~~~ Landy
|
|
|
|
|
Are you sure it's not:
DRIVE NAME:\Program Files\Microsoft Visual Studio\VC98\ATL\Include
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am having problems with a combobox that has a datasource. I am trying to set the selected item after the comobobox has been created
an example of my code is
DataRow* row;
row = playerDataSet1->Player->get_Rows()->get_Item(index);
myComboBox->set_SelectedValue(row->get_Item(:PlayerID));
this works perfectly when I run with the debugger, but as soon as I run without the debugger it doesnt seem to work
Any ideas of how to fix this would be appreciated
Thanks
Randy
|
|
|
|
|
Can anyone give me help in installing the boost libraries in VS.NET 2005 beta?
|
|
|
|
|
Does anyone happen to have a complete buildable project using ClistBox::CompareItem()?
If I set the list box to "has strings", CompareItem() is never called. If I uncheck "has strings", then CompareItem() is called, but all the information in the COMPAREITEMSTRUCT regarding item 2 appears to be garbage.
Thanks
|
|
|
|
|
It's been a while since I used that, but I found some code for an owner-drawn CClassListBox (derived from CListBox) without "has strings", in which:
I added items to the listbox using something like
int CClassListBox::AddItem(CFormClass* pClass)
{
ASSERT_VALID(pClass);
return AddString((char*) pClass);
}
int CClassListBox::InsertItem(UINT nIndex, CFormClass* pClass)
{
ASSERT_VALID(pClass);
return InsertString(nIndex, (char*) pClass);
}
then DrawItem, MeasureItem, CompareItem, etc., received these CFormClass pointers as the itemData fields. The CompareItem() implementation was:
int CClassListBox::CompareItem(LPCOMPAREITEMSTRUCT lpCIS)
{
CFormClass* pI1 = (CFormClass*) lpCIS->itemData1;
CFormClass* pI2 = (CFormClass*) lpCIS->itemData2;
ASSERT_VALID(pI1);
ASSERT_VALID(pI2);
ASSERT(pI1->IsKindOf(RUNTIME_CLASS(CFormClass)));
ASSERT(pI2->IsKindOf(RUNTIME_CLASS(CFormClass)));
if (pI1->IsGraphic() && !pI2->IsGraphic())
return -1;
if (!pI1->IsGraphic() && pI2->IsGraphic())
return 1;
int i = stricmp(pI1->GetName(),pI2->GetName());
if (i < 0)
i = -1;
else if (i > 0)
i = 1;
return i;
}
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi,
I am doing a project in win32.I have a multiline edit control.I want to set the text of the edit control with a string. My string has many lines seperated by LF. When I set the text to edit using WM_SETTEXT or setwindowtext(), I see a small square character in the places of LF and all the lines are printed as single line seperated with square box. My edit control is not accepting the LF. How do I do it..If I print the same srting in static control then it is printing correctly. It happens only with edit.
Thanks a lot.
|
|
|
|
|
Try \r\n instead of \n
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
I have a CList variable. I need to modify the contents of the objects within the CList. I iterate through it as follows:
CList <cpumpinfo, cpumpinfo&=""> mPumpList;
CPumpInfo currPump;
POSITION pos = mPumpList.GetHeadPosition();
for (int index=0; index < mPumpList.GetCount(); index++)
{
currPump = mPumpList.GetNext(pos);
currPump.SetState(PUMP_STOP_STATE);
}
For some reason, when I call SetState on the object in the list, the value isnt saved.
I want to know why any changes to the object within the list arent saved? Any ideas? Thanks.
|
|
|
|
|
That's because you are storing CPumpInfo objects not CPumpInfo* objects. Store pointers instead and it'll work.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Geeez... thanks. Why didnt I think of that! It works now.
-C
|
|
|
|