|
There are two steps to go about it:
1. Uncompress the archive using the same library that you used to compress.
2. Given the extracted file is a tiff image, you can use a virtual pdf printer to print to PDF. Or if you are wanting to do this from your program, use a pdf library like Haru[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Hi....
Thnx for the reply....
I downloaded the code and executed it on the tiff files that i have.
The code seems to execute perfectly for the tiff files that are of 'CCIT Group 4 FAX' and 'CCIT Group 3 FAX '.But for the files having compression type as 'LZW', i get a blank PDF file as output.
Please do let me know is there a way of converting the LZW type tiff files.
Thank You.
|
|
|
|
|
I don't get it. Are the tiff files compressed to an archive using LZW or the tiff compression itself uses the LZW algorithm to reduce size?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: the tiff compression itself uses the LZW algorithm
That one. TIFF files can use many different compression formats. I remember, many, many, many years ago, writing an encoder or decoder (can't remember which) for TIFF files with CCITT group 3 compression on an IBM mainframe using PL/I. That was an experience...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi....
Actually here i have been given a set of tiff files.Now when you go and look into each tiff file's page properties (View Menu -> Page properties), you will be able to see its compression type.My task requires the tiff files with 'LZW' type compression to be converted to PDF.Wheni execute the code that you had suggested in your previous link, i get a blank PDF file.It seems to work for the other tiff files with different compression type but for the LZW compression type it doesn't seem to work. I have no idea what to do.
Please do let me know if you have any solution.Thanks alot.
|
|
|
|
|
Hi all,
i m working on Visual Studio 2008.
i m working on Windows based mobiloe,on XP active sync ia works so i m using RAPI for connection and other functionns,but this is not working in case of Mobile device center.
because for Vista and later mobile device center in required.
so please tell me what can i use for mobile device center.
if possible please explain me with example.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi All
How can i convert double to CString in vc++?Plz help me
|
|
|
|
|
double d = 12.3;<br />
CString cs;<br />
cs.Format("%f", d);<br />
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
I have a third party dll which I registered with /i option.
Like regsvr32 /i:"someGUID" "DllPath" .registration succeeded.
I could notice that With /i option DllInstall function is also called with DllRegisterServer.
Now for me to use this dll I should call a function of it with the "someGUID" which it compares and returns successfully.
1)I would like to know what it does internally? Where does it store the GUID for comparing?
The dll has some function which takes strings(file paths) as input.
and displays as a list when we call another function of it.
Now I close my application and register the same third party dll with another GUID to use it in another application.I have repeated the above process.
When I got the list of all strings that it has it also shows the strings which it stored from the first application.I tried to find them in registry and also for any text files in the directory where the dll resides but of know use.
2)I would like to know where else can we save strings in windows other than files and registries.
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
narayanagvs wrote:
1)I would like to know what it does internally? Where does it store the GUID for comparing?
The source code to regsvr32 is here:
INFO: How Regsvr32.exe Registers and Unregisters COM DLLs[^]
Ultimately the COM interface information is stored in the registry database:
HKEY_CLASSES_ROOT\CLSID
HKEY_CLASSES_ROOT\AppID
HKEY_LOCAL_MACHINE\Software\Classes\CLSID
HKEY_CURRENT_USER\Software\Classes\CLSID
narayanagvs wrote:
2)I would like to know where else can we save strings in windows other than files and registries.
I dont understand the question, the registry is also a file. Are you asking where to save information other than a hard drive.
Best Wishes,
-David Delaune
|
|
|
|
|
Hello
I have a menu class derived from CMenu whose purpose is to change the menu of the FrameWindow according to the childwindow which is done fine. But through the CMenu class can I add Alt key buttons or accelerators.
Prithaa
|
|
|
|
|
Erm... Doesn't MFC do what you're asking for automatically?
In an MDI program, you'll see a pMainFrame->LoadFrame (IDR...) line, which tells MFC which menu to use when you have no document loaded (and hence no childframe).
Next, you'll have a template being loaded, and the first parameter of the new template is a resource ID, which points to (among other things) a menu ID to use when that template is in action.
If that's all your custom menu class does, I think you can get rid of it...
As for alt keys, that's only partly the job of the menu. If you use the & key in front of a menu title (eg, &File), then that key will be highlit, and pressing Alt-F will bring up the file menu. Then you can do the same for menu items (ie, &Open), and then you can use Alt-F followed by O to use the file open menu...
For hot keys, (ie, Alt-f3 being file open), you need to set the accelerator table.
For more complex things, like adding accelerator values automatically to the menu, and toobar buttons also, have a look at the following article. It may be over the top, but it's very good!
http://www.codeproject.com/KB/menus/newmenuxpstyle.aspx
Owner Drawn Menu with Icons, Titles and Shading[^]
Good luck,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
I have problem in style or appearance of the Menu bar and document in document view architecture.
In my application the document is dipped inside compare to menu bar (example if you open a notepad u can identify the menu bar is some what high and document is slightly dipped inside)
But I need the appearance the document should be high compare to menu bar (Example if open windows calculator u can see the document is high compare to menu bar)
Please give me suggestion to do this and is this possible to do in SDI or MDI architecture?
|
|
|
|
|
I don't know if I fully understand you, but you could try to remove the client edge style in the view class.
ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I had tried already , I removed client edge in style itself, even if we put thick frame style we are not getting the result
|
|
|
|
|
I actually tried it in OnInitialUpdate function of the View class and it worked.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
i have the following code to print the input and the output of 2 deifferent classes / fileds when i click the : print output or print input the programm comes to the function PrintOutput or PrintInput inside these 2 functions i have this code line to reset the cursor
position in the right filed which content to be printed and set the windows message to ID_FILE_PRINT which is in the normal case the element to be clicked in order to call OnFilePrint(). when i use OnFilePrint()indicators get an Assert debug failure because hDC is not intialized, i do not kn ow if this is the right way to solve this problem.
this is in the file sql_input.cpp
void CSQL_Input_View::OnPrintInput ()
{
m_wndSplitter.SetActivePane(0,0,0); // reset cursor position
PostMessage (WM_COMMAND, ID_FILE_PRINT);
//CEditView::OnFilePrint();
}
and this is in the file sql_output.cpp
void CSQL_Output_View::OnPrintOutput ()
{
m_wndSplitter.SetActivePane(1,0,0); // reset cursor position
PostMessage (WM_COMMAND, ID_FILE_PRINT);
//CEditView::OnFilePrint();
}
Any help would be appriciated.
|
|
|
|
|
Here the code of a "pulsar" in Qt context. QMTPulsar is an abstract class used for execution of periodic switches, and execute a function at the end of each period. The compilation message is given.
Best regards.
> QMThreadOneAction is used to run asynchronously a function;
La création des QMThreadOneAction est incorrecte.
//-------------------------------------
/** QMTPulsar.h
> Pulse component
- mechanism of periodic (or not) raise and fall call
*/
#ifndef __TESTUTILS_H__
#define __TESTUTILS_H__
#ifdef DEVICELOADER_EXPORTS
#define DEVICELOADER_API __declspec(dllexport)
#else
#define DEVICELOADER_API __declspec(dllimport)
#endif
#include "QtCore/QtGlobal"
#include "QtCore/QThread"
#include "MTDevicePrv.h"
//-------------------------------------
/** QMTPulsar
> process up and down switches, and function execution at each switch.
*/
class DEVICELOADER_API QMTPulsar :
public QThread
{
//-------------------------------------
/** QMThreadOneAction
> execute asynchronously a function
*/
class QMThreadOneAction :
public QThread
{
private:
MTDevicePrv *_device;
void (__cdecl* QMTPulsar::_fonc)(MTDevicePrv *dev);
bool _running;
//! execute function once
void run(void)
{
if (_fonc) {
if (!_running) {
_running = true;
try {
_fonc( _device);
}
catch(...){}
_running = false;
}
}
}
public:
//! constructeur
QMThreadOneAction (
MTDevicePrv *dev,
void (__cdecl* QMTPulsar::fonc)(MTDevicePrv *)
)
{
_running = false;
_device = dev;
_fonc = fonc;
}
//! execute asynchronously function
void go( void) {
run();
}
};
private:
MTDevicePrv *_device;
//! start with action or not
/**
_startWithAction = false
F1 F2
_______________
D1 | D2 |
__________
_startWithAction = true
F1 D1 F2
_______________
| | D2
__________
*/
bool _startWithAction;
//! D1 (microsecond)
qint64 _firstDurationMUS;
//! D2 (microsecond)
qint64 _secondDurationMUS;
//! repeat mechanism
bool _periodic;
//! is operating
bool _active;
QMThreadOneAction *_thFirst;
QMThreadOneAction *_thSecond;
//! processing
void run() {
do {
if (!_active) {
QThread::yieldCurrentThread();
}
else {
if (!_startWithAction) {
QThread::usleep( _firstDurationMUS);
_firstAction();
QThread::usleep( _secondDurationMUS);
_secondAction();
}
else {
_firstAction();
QThread::usleep( _firstDurationMUS);
_secondAction();
QThread::usleep( _secondDurationMUS);
}
}
} while( _periodic);
};
//! first action call to implement
void _firstAction( void) {
_thFirst->go();
}
//! second action call to implement
virtual void _secondAction( void) {
_thSecond->go();
}
public:
//! first action call to implement
virtual void fnFirstAction( MTDevicePrv *dev) = 0;
//! second action call to implement
virtual void fnSecondAction( MTDevicePrv *dev) = 0;
/** create pulsar
@param startWithAction start immediately firstAction or not
@param firstDurationMUS first delay in micro sec
@param secondDurationMUS second delay in micro sec
@param periodic periodic or not
@param startActive start activity immediately
*/
QMTPulsar(
MTDevicePrv *dev,
bool startWithAction,
qint64 firstDurationMUS,
qint64 secondDurationMUS,
bool periodic,
bool startActive)
{
_device = dev;
_startWithAction = startWithAction;
_periodic = periodic;
_firstDurationMUS = firstDurationMUS;
_secondDurationMUS = secondDurationMUS;
_active = startActive;
/* error #171)*/ _thFirst = new QMThreadOneAction( _device, fnFirstAction);
/* error #172)*/ _thSecond = new QMThreadOneAction( _device, fnSecondAction);
/*
Compilation en cours...
QMTPulsar.cpp
c:\_projets-cpp2008\deviceframework\deviceframework\devicemanager\qmtpulsar.h(171) : error C3867: &'QMTPulsar::fnFirstAction' : liste d'arguments manquante dans l'appel de fonction ; utilisez 'QMTPulsar::fnFirstAction' pour créer un pointeur vers membre
c:\_projets-cpp2008\deviceframework\deviceframework\devicemanager\qmtpulsar.h(172) : error C3867: &'QMTPulsar::fnSecondAction' : liste d'arguments manquante dans l'appel de fonction ; utilisez 'QMTPulsar::fnSecondAction' pour créer un pointeur vers membre
Le journal de génération a été enregistré à l'emplacement "file://c:\_Projets-CPP2008\DeviceFramework\DeviceFramework\DeviceManager\src\Debug\BuildLog.htm"
DeviceManager - 2 erreur(s), 0 avertissement(s)
*/
run();
};
~QMTPulsar();
//! return owner device
MTDevice* getDevice() const {
return _device ;
}
//! activate (if true) mechanism
virtual void activate(
bool active) {
_active = active;
if (!QThread::isRunning())
run();
};
};
#endif
|
|
|
|
|
I think you are talking about a callback function?
See here[^]
|
|
|
|
|
Hello,
not exactly (see the first sample, and the principle here :
class ClassACTION {
class ClassExecute {
private:
//pointer on function
void (*_func)( string s);
public:
ClassExecute( void (* func)( string s) { _func = func; }
void go() { _func( "hello"); }
}
private:
ClassExecute *_Executor;
public:
void myFunction( string s) { cout << s << " friend." << endl; }
ClassACTION() {
_Executor = new ClassExecute( myFunction); <<< here is the problem (does'nt compile)...
_Executor->go();
}
};
Best regards.
|
|
|
|
|
You need to use &class-name::fnFirstAction and &class-name::fnSecondAction , where class-name is the class that implements those methods.
You don't appear to have any implementation of the methods, though - the only definitions of those two methods that I can see is the abstract method declarations in QMTPulsar - i.e. the following two lines:
virtual void fnFirstAction( MTDevicePrv *dev) = 0;
virtual void fnSecondAction( MTDevicePrv *dev) = 0;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello,
I have a STL map and string values as the key values However recently, i want to search this map as it is like auto-complete ComboBox.
For example,I have keys in the map as such Apple, Pearl, Orange.
When i enter 'A' i want to return Apple from the map.
I know that i can iterate thorough each map object and compare its key, but i think that would inefficient.
Any ideas ?
Bekir.
|
|
|
|
|
Use std::map::lower_bound . For example, the program below gives you a pair of iterators defining the range containing keys starting with 'A':
#include <string>
#include <map>
#include <iostream>
int main(int, char**)
{
std::map<std::string, int> a;
a.insert(std::make_pair("Apple", 1));
a.insert(std::make_pair("Banana", 1));
a.insert(std::make_pair("Pear", 1));
a.insert(std::make_pair("Apricot", 1));
a.insert(std::make_pair("Plum", 1));
std::map<std::string, int>::const_iterator low = a.lower_bound("A");
std::map<std::string, int>::const_iterator hi = a.lower_bound("B");
for(std::map<std::string, int>::const_iterator it=low;it!=hi;++it)
{
std::cout << it->first << std::endl;
}
}
Note that the sample key for the second lower_bound call is just the key you're looking for with the last character incremented by one.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you, this is what i was looking for
Bekir.
|
|
|
|