|
The easiest way is to use a printer driver that sends faxes, and simply print. Other than that, I know of commercial libraries that do it, but nothing free.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
How can i send a fax using Printer Driver.. One of you
Posts mentioned it.
Please help
Christian Graus wrote:
The easiest way is to use a printer driver that sends faxes, and simply print
|
|
|
|
|
Windows comes with them, sometimes, otherwise there are commercial ones. They need to be installed, then you just print.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
|
I'm writing a multithreaded server, I have a method of thread synch setup but I'm pretty certain it's total crap. Can you give me some ideas for efficient thread synching, BTW no MFC, I'm making portable code.
Stephen Caldwell
Blackfission, CEO
http://blackfission.myip.org:81
|
|
|
|
|
Well, multithreading is definitely not part of the C++ standard, so it is just impossible to do portable thread sync code. The closest you can get to portability is probably Boost threads library which offers a common API to underlying multithreading features of the OS.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I know that unix uses pthreads and windows uses handles, i just didn't want someone proposing the use of CCrticalSections and stuff. Hmm....I have an idea about the multithreading...yay unfocused thought.
Stephen Caldwell
Blackfission, CEO
http://blackfission.myip.org:81
|
|
|
|
|
I went through similar portable (Windows and Unix) app once and we ended up with two different class libraries for multithreading – one for Windows and one for Unix with some generic interface classes. Some of the features cannot be implemented for both platforms, for example Window’s WaitForMultipleObjects function does not have any analogues in posix threads. Actually, you can try Java. It will be definitely slow, but portable. I wouldn’t even try.
Serge
|
|
|
|
|
Serge Krynine wrote:
I went through similar portable (Windows and Unix) app once and we ended up with two different class libraries for multithreading – one for Windows and one for Unix with some generic interface classes.
I also think this is a good solution.
I vote pro drink
|
|
|
|
|
Serge Krynine wrote:
I went through similar portable (Windows and Unix) app once and we ended up with two different class libraries for multithreading – one for Windows and one for Unix with some generic interface classes.
What I was going to do was have a bunch of preprocessor #ifdef/#endif interspersed all throughout my thread class. Seperate classes will most likely be more legible.
Stephen Caldwell
Blackfission, CEO
http://blackfission.myip.org:81
|
|
|
|
|
There's an open source implementation of pthreads for Win32, so you could use pthreads for both environments. According to this article, there is no significant performance loss compared to direct Win32 API.
|
|
|
|
|
I agree with what others have said here. Write your code so that your thread sync can be switched out depending on the OS. Don't try to make Unix act like Windows or Windows to act like Unix. Each OS has it's own way of dealing with multi-threading.
If you just have to use one library, then BOOST should work just great.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi all,
I am very sorry, I am beginner with Visual C++
but I have this problem :
I creating some application and I need send message about
kyepress to another application. My code is :
CWnd* poWnd = FindWindow(NULL, "Name of Window"); // I know name from SPY++
if (poWnd != NULL)
poWnd->SendMessage(WM_KEYDOWN,VK_TAB,1);
But this code do not work. What I must do ???
Thank you for all helps
Libor Matejka
|
|
|
|
|
It's probably working, but the target window (the mainframe) may not be the correct destination. You probably want to send the message to a child of the mainframe, perhaps a dialog or edit control?
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Hi,
I'm looking for help writing a utility that searches through all the files in a directory looking for a string. I'd like something as fast an efficient as the Search Assistant provided with Windows. For example, it searches through a 40Mb file for my 9 digit string in about 2 seconds.
Is opening each file in the directory with CreateFile() and then searching through the file the only way or is there something more efficient?
Cheers
Steevie
|
|
|
|
|
This is what I use. Other than strlower it should work as is.
template <class InIt, class FwIt>
bool search_input(InIt begin, InIt end, FwIt find1, FwIt find2)
{
FwIt findstart(find1);
while (begin != end)
{
if (tolower(*begin) == tolower(*find1))
{
while (find1 != find2 && begin != end && tolower(*begin) == tolower(*find1))
{
++find1;
++begin;
}
if (find1 == find2)
{
return true;
}
find1 = findstart;
continue;
}
++begin;
}
return false;
}
bool FindInFile(const char* file, std::string str)
{
std::ifstream In(file, std::ios::in|std::ios::binary);
if (!In)
{
return false;
}
std::string s = str::strlower(std::string(str));
while (search_input(std::istreambuf_iterator<char>(In),
std::istreambuf_iterator<char>(), s.begin(), s.end()))
{
return true;
}
return false;
}
Todd Smith
CPUA 0x007 ... shaken not stirred
|
|
|
|
|
There's also other way - you can use memory-mapped files. Check the docs for CreateFileMapping and MapViewOfFile[Ex].
Have no idea if mapped files will be faster or slower than CreateFile/ReadFile combination. You'll have to measure the performance.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I looking for a way to launch VBScript Macro (VS6 editor environment) from external application or from other Macro
(I know about 3 ways to launch Macro: Shortcut key, ToolBar button, or command line)
Thanks in advance
Didi Gurfinkel
|
|
|
|
|
Hi,
Suppose you have the following scenario:
Log(CString & szMessage);
Log(); // this one reads its message of a member variable
And you need to add time to the messages before logging them. You essentially have two options:
AddTimeToLog(szMessage)
{
AddTime(szMessage);
}
AddTimeToLog()
{
AddTime(m_szMessage);
}
AddTime()
{
//perform the time addition
}
2nd option...
you can also use an if/else style and only use one single function as opposed to 3 functions and get it done...
I was wondering, which one would be considered efficient and at the same time better programming? Would cluttering your class with multiple functions be considered better than creating a code full of if/else conditions.
thanks
|
|
|
|
|
IMO use inline functions.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Or add optional arguments to your functions:
BOOL Log(CString &szMessage, BOOL bAddTime = FALSE);
which you can call like this:-
CString mystring=" no!!!! not another memory leak!";
Log ( mystring);
Log ( mystring, TRUE);
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hi all,
Anyone want to give me some tips on the STL iterator?
I'm trying to implement a binary search on a list. here's a little snippet of code:
typedef struct _key_data{
KEY k;
DATA d;
} key_data;
typedef list<key_data>::iterator KLiterator;
KLiterator m_it_begin;
...
...
...
CKeyList::Search( KEY key )
{
KLiterator temp_it;
int sub_size;
...
...
...
temp_it = m_it_begin + sub_size;
...
...
...
the problem is with my iterator's + operator. When i try and compile I get this error msg:
error C2678: binary '+' : no operator defined which takes a left-hand operand of type 'class std::list<struct CKeyList<double,unsigned int>::_key_data,class std::allocator<struct CKeyList<double,unsigned int>::_k
ey_data> >::iterator' (or there is no acceptable conversion)
now I expect this will turn out to be a really dumb mistake, but I can't figure out why it's not working
Can anyone spot what's wrong?
TIA,
pete
|
|
|
|
|
You're using list. A binary search on list is going to be VERY expensive, as list has only bi-directional iterators. They define operator ++, but not operator +, because you need to step through the elements one at a time, you can't do an arbitrary jump. You need random access iterators for that ( as in vector ).
For the most efficient search on list, use the member function provided.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
Doh!
Random access on a linked list? What was I thinking?
Thanks for pointing that one out.
Christian Graus wrote:
For the most efficient search on list, use the member function provided
do you mean list::sort()? I couldn't find a search function in my documentation.
Does anyone have a clue on how efficient the sort algorithm is. I'm guessing it'll be slower than a qsort() on an array, right?
Pete
|
|
|
|