|
|
Ok this is wat i get when i compile without the switch!
------ Build started: Project: message, Configuration: Debug Win32 ------
Compiling...
main.cpp
e:\gid\my creations\message prank\main.cpp(1) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Build log was saved at "file://e:\Gid\\Message\Debug\BuildLog.htm"
message - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
THis is wat i get when i build(unsucessfully) with the switch!
------ Build started: Project: message, Configuration: Debug Win32 ------
Compiling...
cl : Command line error D8016 : '/RTC1' and '/clr:oldsyntax' command-line options are incompatible
Build log was saved at "file://e:\Gid\Message\Debug\BuildLog.htm"
message - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
(
plz help!
|
|
|
|
|
I figured this out a long , i'm sorry i did'nt post it quick.
It seems for VC express you have to download the PSDK(platform SDK) which enables one to write old win32 code.
Theres a whole video on how to integrate the PSDK into VC express , here is it[^]
I got VS pro , the PSDK is integrated into it.
Gideon
|
|
|
|
|
Hi,
These r the steps I followed and created the project.
I have created a msaccess database with two tables employee and department.
Created a UserDsn in Administrative (odbc)tools and given the name SampleDB.
1)started visualstudiodeveloper6.0.
New->MFC Appwizard (exe)->ODBCSample->OK
2)Single document ->Next
3)Database view without filesupport->DataSoruce->ODBC->SampleDB->employee->Next->Deselected printing and printpriview->Next->Next->Selected Cview->Finish->OK.
4)Insert->Resource->Dialog->New
5)changed th caption to Data entry and ID to IDD_DATAENTRY and changed properties styles as child and thin.Deselected the systemmenu.
6)Added three static texts and three Edit boxes named as EMPNAME,EMPID,SALARY.
7)Activated the classwizard and added new class CdataEntryDlg ok.Then manually I changed the CDialog to CPropertyPage in DataEntryDlg.h and DataEntryDlg.cpp
7)Inserted new dialog resuorce and changed the properties to child and thin and given the name List and ID to IDD_LIST.
8)Dragged three static texts and editboxes
9)Activated classwizard and given the name CListDlg and Base class as CpropertyPage.
10)Then added new class named CPropSheet.
11)In the resources editor expand menu and double click on IDR_Main menu and in the Help menu I added psheet and activated classwizard and added function.to the MainFrm.cpp
12)In that function added body as
void CMainFrame::OnHelpPsheet()
{
CPropSheet psheet("sheet");
CDataEntryDlg dlg;
CListDlg Ldlg;
psheet.AddPage(&dlg);
psheet.AddPage(&Ldlg);
psheet.DoModal();
}
And included the header files #include “PropSheet.h”
#include “DataEntryDlg.h”
#include “ListDlg.h”
13)Insert new resource ->add new class named as CEmpSet (base class Crecordset) and OK.
Selected ODBC as SampleDB(snapshot) then list of table names displayed and selected employee and then OK.
14)again goes to DataEntry dialog and activated the classwizard.
15)And chosen the class info propertypage and selected the foreign class as CEmpSet and added variable m_pSet then OK.
16)Again moved to DataEntry dialog and activated classwizard and mapped the fields .
17) I included EmpSet.h in DataEntryDlg.h file.
Now I compiled successfully and when executing I got assertion failure.
Please can U say what is the wrong with me.
If I comment out the DDX mechanism in the EmpSet.cpp file then the Propertysheet will be created without any values.
Thank u.
Tejaswini.
Tejaswini
|
|
|
|
|
hi all,
i have a requirement to find blocked ports in my system ?
plz help me
regards
GV
|
|
|
|
|
g venu wrote: i have a requirement to find blocked ports in my syst
Search Port Scanner in Google!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello all,
For certain condition in my application I want to disable ok button of property page. Can anybody please tell me how to do that?
regards,
Aj
|
|
|
|
|
|
osanchez@prodys.net wrote: You can do it using CPropertySheet
but he asks for CPropertyPage. Also there is no OK buttons in the CPropertySheet ...right?
nave
|
|
|
|
|
Naveen R wrote: but he asks for CPropertyPage
Yes, i read it very fast
I don't imagine a propertysheet with different ok buttons in each page.
Cheers.
|
|
|
|
|
create a member variable for the OK button and when ever u want call the EnableWindow( FALSE ) to make it disabled.
nave
|
|
|
|
|
|
Hello
I want to create a CheckBox in Dialog in PPC using VC++.
Just like
CButton m_button;
m_button.Create(...);
But I can't declare CCheckBox member in Dialog
How could I create a checkbox in dialog??
Any suggestion is useful!! Thanks!!
|
|
|
|
|
sdhtyjnniutnbjnhbghb wrote: But I can't declare CCheckBox member in Dialog
there is no class called CCheckBox in MFC
u can create a check box by giving the BS_CHECKBOX style in the CButton::Create()
nave
|
|
|
|
|
checkbox has BS_CHECKBOX constant in create for example Create("Button",WS_CHILD|BS_CHECKBOX,...);
whitesky
|
|
|
|
|
Creating a check nox is the same way as a button only the dwStyle changes:-
myButton.Create(_T("Check button"), WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX, <br />
CRect(10,100,100,130), NULL, 1100);
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Hi,
I'm trying to activate a global function for several times (template function).
The only way I can figure how to do it is through a global variable, e.g.:
int dummy = SomeGlobalFunc();
I've wrapped this global variable definition with a preprocessed macro because I want to call the global function several times and for that I need to define a different global variable each time.
The problem is how to define a global variable with a different name each time (I can't use the predefined __COUNTER__ of VS beacause I need this code to be portable).
thanks,
Alon.
|
|
|
|
|
Maybe you can define your macro without the unneeded variable:
#define GLOBAL_CALL SomeGlobalFunc();
Even if the return value is not saved, the global function will be called.
You can also try this:
#define GLOBAL_CALL { int dummy = SomeGlobalFunc(); }
I hope this helps.
|
|
|
|
|
It's not that I need the return value of the global function, but because C++ doesn't support calling global functions I'm doing a little bypass by defining a global variable and initializing it by calling to the required function.
About the second idea, I thought it was a good idea too to define the global variable in a seperated scope and that way to prevent the need of defining different name for each global variable, but... the compiler decieded to yell that it's not possible defining seperated scope under the global scope.
|
|
|
|
|
In case of file level calling, I think you can try this:
#define MERGE1(a, b) a##b
#define MERGE(a, b) MERGE1(a, b)
#define GLOBAL_CALL static MERGE(dummy, __LINE__) = SomeGlobalFunc();
The __LINE__ macro, in contrast with __COUNTER__ , seems to be portable.
I hope it helps.
|
|
|
|
|
Yep, I've already tried this, but then I've realized that I might have several global variables defined in different files but at the same line.
So my next move was trying to concatenate also the __FILE__ macro in all kinds of ways but it didn't work.
What is the right syntax to concatenate dummy , __FILE__ , __LINE__ all in the same variable name ?
|
|
|
|
|
I think the suggested static modifier should prevent name collisions.
|
|
|
|
|
Hi,
I am adding somedetails of a page like page no.page title..etc..
and then im getting value from the same CptrList.
My problem is when adding to list the correct value is entered.But i get the value from list,at that time it shows wrong value.Pls help me..i ll show the code
For adding value to list..
POSITION hPos = GrPageList.GetHeadPosition();
while(hPos)
{
SGraphicsDet *pData = (SGraphicsDet *)GrPageList.GetNext(hPos);
}
pDet->iPageNo = iSelPg;//checked here..its correct
GrPageList.AddTail(pDet);
To get the value:
SGraphicsDet *pGrPgConf;
POSITION pos = GrPageList.GetHeadPosition();
while(pos)
{
pGrPgConf = (SGraphicsDet*)GrPageList.GetNext(pos);
if(pGrPgConf->iPageNo == (giSchPNo + 1))
SetSoftKeys(pGrPgConf,giSchPNo);
}
here pGrPgConf->iPageNo shows the wrong value.
For example in adding the PageNo is 1,but in getting this value it shows 0.
|
|
|
|
|
Anyway I dint go through the entire code. I suggest you to use CPtrArray instead because it is indexed. But the insertion will be much slower than List.
See the difference between the different template classes.
List
The list class provides an ordered, nonindexed list of elements, implemented as a doubly linked list. A list has a "head" and a "tail," and adding or removing elements from the head or tail, or inserting or deleting elements in the middle, is very fast.
Array
The array class provides a dynamically sized, ordered, and integer-indexed array of objects.
Map (also known as a dictionary)
A map is a collection that associates a key object with a value object.
See MSDN for more information.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
Hi,
I created a dialog using createdialog() in win32 program .And in that in created a edit box using createwindow.
I have handled WM_CTLCOLOREDIT like this
case WM_CTLCOLOREDIT:
hdc = (HDC)wParam;
SetTextColor(hdc, RGB(0,0,255));
hdc3 = GetDC(c_hwnd);//c_hwnd is handle to button
crBkgnd = GetBkColor(hdc3);
SetBkColor(hdc,crBkgnd);
GetSysColorBrush(COLOR_3DHILIGHT);
break;
here only i can see the change of color in text but background color is not changing to button default color (color is specified in code using crBkgnd)..
whenever text appears background color will be white...
Thanking you
Manjunath S
GESL
Bangalore
|
|
|
|