|
Ah, crossplatform, that is an entirely different matter. Since everything is a file under *nix you may be able to use straight file operations as long as you know how the printer is connected. Note, however, that Win32 and *nix completely differ on how printers are handled, you will have to right different code for each.
For *nix, look for the CUPS package. This is the only thing I know of that may make things easier for that platform.
Joel Lucsy
|
|
|
|
|
Hi All gurus,
I have a small problem regarding windows startup time..I have to add an application at windows startup..I have found many things on that and I have finished this part..but the real problem occurs when I restart or logoff..I want my application to be the first one to load..after necessary windows..programs..so that user is not able to access anything..before startup..and must see my application first..can anyone help me out..I know something can be done..Any help or pointers are highly appreciated..
Thanks a lot in advance,
Himanshu
|
|
|
|
|
Hi Himanshu
I know 2 ways:
- move your program (link) to the autostart folder
- write your program as service and start the service always -> systemsettings (I think the better way)
Regards
Frank
|
|
|
|
|
There is no way, short of replacing system files, to guarantee that your application will be the first to start. Items in the startup folder are loaded after all services have been loaded. Even if it were a service, you could only guarantee that it start AFTER another application, but never before.
|
|
|
|
|
how to create text editor into single dialog/mfc???? (like notepad)
or can I link notepad into my program??
====================^_^
|
|
|
|
|
ariez wrote:
how to create text editor into single dialog/mfc???? (like notepad)
You can run the MFC application wizard to build an SDI application, but on the very last step, select CEditView as the base class. Compile the program and you will have a text editor without writing a single line of code.
ariez wrote:
or can I link notepad into my program??
You can run notepad from your program by using ShellExecute(). Check MSDN on how to use that function.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Check out the Wordpad example on MSDN.
|
|
|
|
|
Hi,
How to use VC++ to trigger a list box's onChange event for a Select object in a html page.
I use CHtmlView, I can get the Interface of the listbox. I also use put_selectedIndex to chance the select item.
Thanks a lot!!
Alan Shen
|
|
|
|
|
Hi:
I create a splitterwnd in my application with 2 rows ,1 colume.I want to change the size of one pane in the SplitterWnd(such as the view in first row),and I can't find a function in MSDN to do so. How could I do?
Thanks
Benben
|
|
|
|
|
CSplitterWnd::SetRowInfo() , CSplitterWnd::SetColumnInfo()
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"
|
|
|
|
|
Ryan Binns wrote:
CSplitterWnd::SetRowInfo(), CSplitterWnd::SetColumnInfo()
Wow! I looked at them but I didn't really bother reading the info, so my suggestion was to use MoveWindow. Would that work?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Toni78 wrote:
MoveWindow. Would that work?
No. The sizes are cached in the CSplitterWnd class, so bypassing them would produce errors later on.
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"
|
|
|
|
|
Thank you! I'd better delete my reply then.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
But it seems that these function only works for the first row.
when I try CSplitterWnd::SetRowInfo(0,10,10) , it works well.
but if I try CSplitterWnd::SetRowInfo(1,10,10),nothing happen
Thanks
Benben
|
|
|
|
|
Did you call RecalcLayout() ?
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I'm a student. I'm learning windows programming. Now I want to write a wordpad in API and without using edit control. I find there are too much things I must deal with. I'm puzzled.
Would you have something like this. Please give me the sample or source code.
Thank you very much.
Email : goldwing1024@hotmail.com
I want to know
|
|
|
|
|
I have seen a tutorial on how to write a text editor but the whole thing is in Win32 asm. However, the concepts and functions are the same as in API so have a look at this link [^].
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
coolhair wrote:
I want to write a wordpad in API and without using edit control. I find there are too much things I must deal with. I'm puzzled.
I'm not surprised. Why would you consider writing a text editor without using an edit control?
|
|
|
|
|
DavidCrow wrote:
Why would you consider writing a text editor without using an edit control?
Good point. Although I've done it . Edit controls and rich edit controls weren't enough for what I needed, so I wrote my own. Works beautifully
I certainly wouldn't recommend it without a few years Windows programming experience though. It was a substantial project
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"
|
|
|
|
|
Hi! I am new to C++. I want to implement the any size integer class. But I got link error, the vs.net 2003 show this error message:
MyLargeInt error LNK2019: unresolved external symbol "public: __thiscall LargeInt<60>::~LargeInt<60>(void)" (??1?$LargeInt@$0DM@@@QAE@XZ) referenced in function _main
Please help me! Thank you!
here is my code,I haven't complete the code yet
//LargeInt.h My any size integer class header file
#pragma once
#include <iostream>
using namespace std;
template<int i_size>
class LargeInt
{
friend ostream & operator << (ostream &,const LargeInt&);
friend istream & operator >> (istream &,LargeInt&);
public:
LargeInt(int number);
~LargeInt(void);
private:
int size;
int *data;
bool negative;
};
//LargeInt.cpp My any size integer class implement file
#include "StdAfx.h"
#include ".\largeint.h"
template<int i_size>
ostream &operator << (ostream& output,const LargeInt<i_size>& temp)
{
//int counter;
if (temp.negative)
output<<"-";
for (int i=temp.size;i!=0;i--)
output<<temp.data[i];
return output;
}
template<int i_size>
istream &operator >> (istream& input,LargeInt<i_size>& temp)
{
char ch;
int counter = 0;
int *buffer;
buffer=new int[temp.size];
memset(temp.data,0,temp.size);
memset(buffer,0,temp.size);
while((ch = input.get()) != '\n')
{ //loop while they have not entered a RETURN
if( (counter == 0) && (ch == '-') )
{
temp.negative = true;
}
else
{
if((ch >= 48) && (ch <= 57))
buffer[counter] = ch - 48;
counter++;
}
}
temp.size = counter;
i = 0;
for (int i=0;i<counter;i++)
{
temp.data[i]=buffer[counter-i]
}
delete[] buffer;
return input;
}
template<int i_size>
LargeInt< i_size >::LargeInt(int number)
{
int temp;
data=new int[i_size];
memset(data,0,i_size);
negative=(number>0?false:true);
negative=true?number=-number:;
temp=number;
if (number == 0)
{
data[0] = 0;
size = 1;
}
else
{
for(size = 1; ; size++)
{
data[size-1] = temp % 10;
temp = int(temp) / int(10);
if(temp == 0)
break;
}
}
}
template<int i_size>
LargeInt< i_size >::~LargeInt(void)
{
delete[] data;
}
// MyLargeInt.cpp : Defines the entry point for the console application.
// Main test file
#include "stdafx.h"
#include "iostream"
#include "LargeInt.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
LargeInt<60> myi=120;//I want a integer that can hold 60 digit length
return 0;
}
Let's roll!
|
|
|
|
|
Eastdragon wrote:
LargeInt<60> myi=120;//I want a integer that can hold 60 digit length
I didn't really go through your code but I don't think you can assign a number to myi, because LargeInt class doesn't have an assignment operator. LargeInt<60> myi(120) would be the correct syntax (I can't exactly remember how templates work).
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Unfortunately that is the right syntax. In C++ "=" operator cannot be override, and LargeInt<60> myi=120 should call
LargeInt< i_size >::LargeInt(int number)
so that i_size=60 and number=120
My code can be compiled, but has link errors.
Let's roll!
|
|
|
|
|
Eastdragon wrote:
In C++ "=" operator cannot be override
No offense, but where did you hear that?
Eastdragon wrote:
LargeInt<60> myi=120 should call
LargeInt< i_size >::LargeInt(int number)
Sorry, you are right about that (but only in you case). You must provide copy constructors for more complicated classes.
Your code compiles just fine and I don't have any errors. Actually, this line negative=true?number=-number:; gives errors. But then again, you say that you have no errors. Since I don't have a problem compiling your code I don't know what your problem could be. Try to put everything in one file (remove the include directives that are not needed) and see if it works. If it does work then there something wrong with your header declarations.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Toni78 wrote:
In C++ "=" operator cannot be override
No offense, but where did you hear that?
Well,I got to know that "=" cannot be override in MSDN April 2003 CDs.
It's table says:
=, ., ?:, ->, new, is, sizeof, typeof These operators cannot be overloaded.
and the artical's title is "operator overloading, overloadable operators"
Please take a look!
I said vs.net 2003 can compile my code, but have link errors.
Let's roll!
|
|
|
|
|
const CString& operator =(
const CString& stringSrc );
const CString& operator =(
TCHAR ch );
const CString& operator =(
char ch );
const CString& operator = (
LPCWSTR lpsz );
const CString& operator =(
LPCSTR lpsz );
const CString& operator =(
const unsigned char* psz );
No operator= overloading you say? this was taken directly from the msdn online help...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|