|
what exactly do you mean.....you can for example define an environment variable like "somepath" which contains some path "C:\temp". This variable can be used in your project settings as $(somepath). Does this help any?
|
|
|
|
|
Yes, this is how it works for a path - I wonder if it works for a #define...
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
The /D compiler switch should help here. Use /DSYMBOL to simply define a symbol, or /DSYMBOL=value to give it a value.
I'm not sure whether you want the contents of the switch to come from an environment variable, or you want the put the define in an environment variable.
For the first case, you can use %PATH% or equivalent from the command line, or $(PATH) from inside Visual Studio.
For the second case, use the CL environment variable, but in this case you have to replace '=' with '#' when assigning values to the variables.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I can use
if(ndx=m_comboBox.GetCurSel()==LB_ERR) {
MessageBox("please,choose one of them !");
return;
}
for comboBox.
How can I warn when I use editBox?
emroz
|
|
|
|
|
CString s;
m_editBox.GetWindowText(s);
if(s.IsEmpty()){
.........
}
|
|
|
|
|
I dont exactly understand what you want,
but maybe:
if(a!=c)
((atof(a)/atof(e))*(atof(e)-atof(f)))/(atof(a)-atof(c))
of you will get a div by zero bugy some day.
|
|
|
|
|
if (m_edit.GetWindowTextLength() == 0)
MesssageBox("Please enter some text!", ...);
|
|
|
|
|
Hi everybody!
Can anybody tell me how to use BSTR and _bstr_t properly?
I have an array of _bstr_t strings putting them into this array like this:
<br />
_bstr_t* arr = new _bstr_t[100];<br />
<br />
arr[0] = L"string_one" + _bstr_t(BSTR_string) + L"string_three";<br />
arr[1] += L"string";<br />
My problem: Sometimes there are other array elements affected by changing the content of other ones!!!
Idea: It seems to be a problem of using pointers internally by _bstr_t or missing "SysAllocString" function use...
|
|
|
|
|
HI,
Can anyone help me with this. I have a program that will connect to data base server using postgres. I would appreciate any help...
Thanks !
Mar Solero Jr.
|
|
|
|
|
Have you tried the PostGreSQL ODBC driver?
onwards and upwards...
|
|
|
|
|
Hi all
I try to open file use _open routine with OF_BINARY|OF_RDWR|CF_CREAT|CF_TRUNC parameters but when i open first file _open("ffile",_O_BINARY|_O_RDWR|_O_CREAT|_O_TRUNC) file created fine.
But when i try to open another file _open("sfile",_O_BINARY|_O_RDWR|_O_CREAT|_O_TRUNC)file created too but have read only atribute.
Why this file has read only atribute, i use same parameters
as a first time but in first file dont have this atribute but in second time file have one??
|
|
|
|
|
Looking at the MSDN for _open it states:
The pmode argument is required only when _O_CREAT is specified. If the file already exists, pmode is ignored. Otherwise, pmode specifies the file permission settings, which are set when the new file is closed the first time
So basically you need to specify the 3rd argument to specify the permissions:
_open ("ffile",_O_BINARY|_O_RDWR|_O_CREAT|_O_TRUNC, _S_IREAD | _S_IWRITE )
I would image not giving the pmode in this case causes the subtle error you described.
|
|
|
|
|
in a treectrl,when a root item is expanded , a kind of icon associated with the item is displayed,and when that root item is shrink,another kind of the icon is displayed. thank you
|
|
|
|
|
If you browse the Platform SDK, and look at the overview for Tree View controls, it has a few paragraphs
about "Item States", which is what you are interested in.
Look up these member functions / messages as well:
CTreeCtrl::SetImageList (CImageList *, TVSIL_STATE) / TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)hImageList.
Iain.
|
|
|
|
|
hi,
create a imagelist
.h
CImageList m_cImageList;
.cpp
populate event()
if (1) //bDoThisOnlyOnce
m_cImageList.Create(IDB_TREEVIEW, 16, 10, RGB (255, 0, 255));
//IDB_TREEVIEW resource bitmap with a the all icons
GetTreeCtrl().SetImageList(&m_cImageList, TVSIL_NORMAL);
rootitem = GetTreeCtrl().InsertItem(TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, _T("RootItem"), ILI_CLOSED_FOLDER, ILI_CLOSED_FOLDER, 0, 0, -1, TVI_ROOT, TVI_SORT );
//ILI_CLOSED_FOLDER, ILI_CLOSED_FOLDER <- item nr of imagelist
Add msg
.h
afx_msg void OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult);
.cpp
void CMyTreeView::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
CString string;string = GetPathFromItem (hItem);
*pResult = FALSE;
int inImage, inSelectedImage;
if (pNMTreeView->action == TVE_EXPAND)
{
if (GetTreeCtrl().GetParentItem (hItem) == NULL )
{
GetTreeCtrl().GetItemImage( hItem, inImage, inSelectedImage );
if (inImage == ILI_CLOSED_FOLDER && inSelectedImage == ILI_CLOSED_FOLDER)
{
GetTreeCtrl().SetItemImage( hItem, ILI_OPEN_FOLDER, ILI_OPEN_FOLDER);
}
}
}
else
{ // pNMTreeView->action == TVE_COLLAPSE
if (GetTreeCtrl().GetParentItem (hItem) == NULL)
{
GetTreeCtrl().GetItemImage( hItem, inImage, inSelectedImage );
if (inImage == ILI_OPEN_FOLDER && inSelectedImage == ILI_OPEN_FOLDER)
{
GetTreeCtrl().SetItemImage( hItem, ILI_CLOSED_FOLDER, LI_CLOSED_FOLDER);
}
}
}
hope it helps
dan o
hope it helps
|
|
|
|
|
Hi all,
I use MSComm for serial communication with very simple external device:
CComVariant Transfer;
VariantClear(&Transfer);
Transfer = CString(CString((char)P_1) + CString((char)P_2) + CString((char)D_1) + CString((char)P_3));
msComm.SetOutput(Transfer);
// Wait for answer
VariantClear(&Transfer);
Transfer = msComm.GetInput();
CString sReturned = Transfer.bstrVal;
P_1, P_2, D_1, P_3 are constants and usually non zero - however, zero value generate problem. When D_1 == 0, CString is shortened (P_3 is missing) and communication fall in troubles.
How can I enter binary array into Transfer instead of text string? How can I retrieve binary array from Transfer filled with response?
Environment: W2k, VC++ 6
Thanks for suggestions.
Petr
|
|
|
|
|
<strike> :(Hallo !!
Ich suche Leute zum lernen von MFC und C++.
Ich komme aus der nähe von Dortmund und suche Leute aus dieser Region um sich 1 mal die Woche zu treffen und sich gemeinsam auszutauschen und zu lernen
Meldet Euch
cu
Dirk
cadnt@web.de</strike>
schonus
|
|
|
|
|
Das ist English-speaking site AFAIK
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
|
Hello,
I've implemented double-buffering in my windows based game but the movement is still "choppy". Does anybody know how to get rid of this effect (i.e. syncronize the object's movement with the screen build-up)? Under DOS and Win16 I used to do this by reading directly from the VGA port but Win32 won't allow this.
thankx,
Koxin
|
|
|
|
|
In normal GDI, you can't do this. The nearest you can come is to draw into a memory DC and bitblt
it to the screen in one go. Which I assume you have done.
You need to move to DirectDraw / Direct3D. Then you can draw into a "back surface", and flip it
to the front synchronously with the screen redraw.
Such a change is beyond an answer in this forum, but there is a DirectX section on codeproject
which has a lot of examples for you.
Iain.
|
|
|
|
|
hi
i have written a macro, which will comment/uncomment all the occurences of a particular function call like all printfs in the opened file
i want to do the same operation for all project files,
can any one help me,
Regards
Sunil
|
|
|
|
|
How to PRINT MsWord Document through VC++ Dialog based Program.
Please Help me ..
|
|
|
|
|
hm.... If Word is installed on the PC, then you can
use ShellExecute() with the the "print" param.
If word is not installed....
|
|
|
|
|
Hello,
I have a graph displayed in a window. I want to save that graph in a .bmp file. I use VC++ 6.0 and MFC. How can i do that?
Best Regards
Neha
|
|
|
|