Click here to Skip to main content
16,007,443 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralIncorporation of C files to C++ Pin
Keck15-Dec-04 5:32
Keck15-Dec-04 5:32 
GeneralRe: Incorporation of C files to C++ Pin
toxcct15-Dec-04 5:37
toxcct15-Dec-04 5:37 
GeneralRe: Incorporation of C files to C++ Pin
Blake Miller15-Dec-04 10:25
Blake Miller15-Dec-04 10:25 
Generaladding manage extension to exiting c++ application. Pin
pnpfriend15-Dec-04 5:27
pnpfriend15-Dec-04 5:27 
Questionhow to access mainframe from the object Pin
josephvan15-Dec-04 3:06
josephvan15-Dec-04 3:06 
AnswerRe: how to access mainframe from the object Pin
David Crow15-Dec-04 3:37
David Crow15-Dec-04 3:37 
GeneralRe: how to access mainframe from the object Pin
josephvan15-Dec-04 18:01
josephvan15-Dec-04 18:01 
General"Writing" to parallel port in XP Pin
Blubbo15-Dec-04 2:05
Blubbo15-Dec-04 2:05 
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 />
//---------------------------------------------------------------------------<br />
#pragma package(smart_init)<br />
#pragma resource "*.dfm"<br />
TLabel_Test *Label_Test;<br />
//---------------------------------------------------------------------------<br />
__fastcall TLabel_Test::TLabel_Test(TComponent* Owner)<br />
        : TForm(Owner)<br />
{<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 />
}

Generalminimum size of win32 application Pin
includeh1015-Dec-04 1:17
includeh1015-Dec-04 1:17 
GeneralRe: minimum size of win32 application Pin
gamitech15-Dec-04 1:21
gamitech15-Dec-04 1:21 
GeneralRe: minimum size of win32 application Pin
User 665815-Dec-04 2:04
User 665815-Dec-04 2:04 
GeneralRe: minimum size of win32 application Pin
David Crow15-Dec-04 3:39
David Crow15-Dec-04 3:39 
GeneralRe: minimum size of win32 application Pin
includeh1015-Dec-04 19:45
includeh1015-Dec-04 19:45 
GeneralDuplicate Items in Treeview Pin
@cE15-Dec-04 1:08
@cE15-Dec-04 1:08 
GeneralRe: Duplicate Items in Treeview Pin
includeh1015-Dec-04 1:20
includeh1015-Dec-04 1:20 
GeneralRe: Duplicate Items in Treeview Pin
josephvan15-Dec-04 18:14
josephvan15-Dec-04 18:14 
GeneralInvoke ON_BN_CLICKED manually Pin
Karthikeyan Muthurajan15-Dec-04 1:02
Karthikeyan Muthurajan15-Dec-04 1:02 
GeneralRe: Invoke ON_BN_CLICKED manually Pin
includeh1015-Dec-04 1:25
includeh1015-Dec-04 1:25 
GeneralRe: Invoke ON_BN_CLICKED manually Pin
David Crow15-Dec-04 3:41
David Crow15-Dec-04 3:41 
GeneralRe: Invoke ON_BN_CLICKED manually Pin
Prakash Nadar15-Dec-04 4:47
Prakash Nadar15-Dec-04 4:47 
GeneralRe: Invoke ON_BN_CLICKED manually Pin
Ivan Cachicatari15-Dec-04 7:28
Ivan Cachicatari15-Dec-04 7:28 
Generalskin for slider control. Pin
verma-rahul15-Dec-04 0:17
verma-rahul15-Dec-04 0:17 
Generalstatic control Pin
shubhishubhi15-Dec-04 0:06
shubhishubhi15-Dec-04 0:06 
GeneralRe: static control Pin
includeh1015-Dec-04 1:02
includeh1015-Dec-04 1:02 
GeneralChecking if an exe file is running Pin
Member 158681215-Dec-04 0:01
Member 158681215-Dec-04 0:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.