|
disable precompiled headers with the VC++ settings > Debug, don't use precompiled Headers.
this error has no relationship with convert C to C++.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You can disable precompiled headers for SPECIFIC source files wihtin your project, leaving the C++ files to continue to use the precompiled headers They don't have to be disabled for the entire project just because you added one o rmore C files to an otherwise perfect C++ project.
Just expand the project tree so that youc an see the source files, right click on the C source files, and adjust the precompiled header settings for that specific file.
|
|
|
|
|
Hi!
I want to add manage extension to my exiting c++ MFC application.
and I found the following link but I couldn't find Compile As Manage property at all.
I chose YES for Use Manage Extension in General property of Configure Properties Folder.
How can add manage extension to my exiting c++ dialog based application so I can use System, System::Text, and other System properties?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/vcconaddingmctoexistingapplication.asp[^]
Right now.. even I add
<br />
using namespace System;<br />
using namespace System::Text;<br />
<br />
...<br />
...<br />
Text t;<br />
and the error is Text is not a namespace. I dont 'know why.
Thank you.
|
|
|
|
|
i define a object from one of my own class in CMainframe, then i wanna get a pointer to this CMainframe inside the object, how can i do that?
ps.my own class is derived from CDocument
Josephvan thanks for your attention
|
|
|
|
|
josephvan wrote:
...i wanna get a pointer to this CMainframe...
How about AfxGetMainWnd() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thanks, it i'll try it
Josephvan thanks for your attention
|
|
|
|
|
I may have posted this earlier... Anyway... this was written in Borland Builder. This code was written in c++ language. I'm trying to clarify on what's going on. I"m trying to send the message text to the printer. This code did work in Win98. BTW, is there any Borland c++ anywhere in the 'net? The Bynamic-c website is no longer there.
<br />
<br />
#include <vcl.h><br />
#pragma hdrstop<br />
<br />
#include "labeltest.h"<br />
#include <windows.h><br />
#include <time.h><br />
#pragma package(smart_init)<br />
#pragma resource "*.dfm"<br />
TLabel_Test *Label_Test;<br />
__fastcall TLabel_Test::TLabel_Test(TComponent* Owner)<br />
: TForm(Owner)<br />
{<br />
}<br />
<br />
void __fastcall TLabel_Test::btnPrintClick(TObject *Sender)<br />
{<br />
<br />
DWORD numsent;<br />
OVERLAPPED overlapped;<br />
char LabelString[500];<br />
char *Port = "LPT3";<br />
strcpy(LabelString, "A");<br />
strcat(LabelString, "Print Count > 25000 *");<br />
strcat(LabelString, "Q1Z");<br />
Retry:<br />
HANDLE hCom =<br />
CreateFile(Port,GENERIC_READ|GENERIC_WRITE,NULL,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL);<br />
if(hCom == INVALID_HANDLE_VALUE)<br />
{<br />
edtStatus->Text = "Error. Printer Offline";<br />
return;<br />
}<br />
WriteFile(hCom, LabelString, strlen(LabelString), &numsent, &overlapped);<br />
WaitForSingleObject(overlapped.hEvent, 1000);<br />
GetOverlappedResult(hCom, &overlapped, &numsent, FALSE);<br />
CloseHandle(hCom);<br />
if(numsent < strlen(LabelString))<br />
{<br />
edtStatus->Text = "Error. Printer Offline";<br />
return;<br />
}<br />
}
|
|
|
|
|
i have a win32 app - it runs at background, no any user interface such as dialogs or windows.
the size of the app is very important, but it is almost up to 60K, i need to make it much smaller - do you have comments for me?
thx
includeh10
|
|
|
|
|
are you sure because I have an application with a lot of dialogs (4) and also a large code and it only has 112 KB (114.688 bytes). Are you sure you compiled it in release mode ?
The thing is that there is a program (i don't kn ow its name right now) that makes your exe's 200% smaller.
Good luck
gabby
|
|
|
|
|
UPX does that, for example
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Read this article to make sure you understand what you are asking.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
the program will be up-loaded and down-loaded very often.
includeh10
|
|
|
|
|
Hi,
I have a problem with sorting duplicate items in a treeview.
I retrive some info from a database and the resultset look something like this :
Date....|City.....|Code
---------------------------
20041012|London...|123
20041012|London...|456
20041012|New York.|763
20041013|Boston...|236
20041013|London...|983
20041012|Oslo.....|923
And I want the treeview to look like this :
+20041012
...+London
......+123
......+456
...+New York
......+763
...+Oslo
......+923
+20041013
...+Boston
......+236
...+London
......+983
How can i put the correct nodes in the correct level and do this in a easy way?
Tune In, Turn On, Drop Out
|
|
|
|
|
tree-view has a sorting function, it is good enough for your case.
includeh10
|
|
|
|
|
HTREEITEM htiParent = m_pTreeCtrl->InsertItem (strTreeItems[0]);
HTREEITEM htiChild; // child item
htiChild = m_pTreeCtrl->InsertItem (strTreeItems[1], 1, 1, htiParent, TVI_LAST);
m_pTreeCtrl->SetItemState (htiChild, TVIS_BOLD, TVIS_BOLD);
// add the children of the parent item
for (int i = 1; i < 4; i++) {
m_pTreeCtrl->InsertItem (strTreeItems[2], 2, 3, htiChild, TVI_LAST);
}
the code works as you wish, strTreeItems[x] is the Itemtext, that's looks like
+strTreeItems[0]
++strTreeItems[1]
+++strTreeItems[2]
+++strTreeItems[2]
+++strTreeItems[2]
+++strTreeItems[2]
you can do it yourself i think~~~~~~~~~enjoy
cheer up!!!!!
|
|
|
|
|
I want to invoke ON_BN_CLICKED event of a button named bn_test manually from my code. Is there any possibility to invoke in this way?
|
|
|
|
|
if the button has an unique ID, i think you can add it as code auto generated by MFC.
includeh10
|
|
|
|
|
Why not just call the handler function directly?
BEGIN_MESSAGE_MAP(COptionsGeneralPage, CPropertyPage)
ON_BN_CLICKED(IDC_XB_ODBC_ENABLED, OnXbOdbcEnabled)
END_MESSAGE_MAP()
...
OnXbOdbcEnabled();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
just post the wm_command event to the window with the id of the button
-prakash
|
|
|
|
|
|
I am creating a project which needs to skin a slidder control.This skin should be of .PNG file.How can i load image using the path of image file insted of Resource ID or name. I have seen article by JON "Skin based slider control Mark 2" but this is to load bmp file and by resource ID.
Pls help me
Learner always
|
|
|
|
|
Resizing the static control at runtime depending on the dynamic text.This shud increase or decrease the height to accomodate the text.And text shud wrap up.
Can anybody help plz.
|
|
|
|
|
use CDC to get size of your text then determine width and height of static control, i think there is no simple (or auto) way to do that.
includeh10
|
|
|
|
|
Hi I have two seperate exe files (both console applications) and I am looking for some ideas as to how I can deterimine if the other one is running so I can set the other one to sleep. Any help would be most appreciated
|
|
|
|
|
there is one C++ sample in article section of the forum, it is very good about running single copy program - exe file can not multiplely run - the sample detects if the exe (itself in the sample) is running.
you can modify the sample for detecting if another exe is running.
try to search it, the sample uses Mapping file.
includeh10
|
|
|
|