|
hi
Thank you for ur kind reply.
There will be some way like accessing a camera with the default driver installed in the machine. I want something similar to that!!!!
||SnAkeBed||
|
|
|
|
|
drivers for that USB device is alrady installed
||SnAkeBed||
|
|
|
|
|
Then look on the website for the company that makes the scanner. They'll probably have documentation.
It's also possible that it acts just like an A4 scanner, only little and higher resolution.
In which case, maybe the driver comes with a TWAIN interface? I'm no expert on that.
Can you capture images using (eg) Photoshop? Did it come with applications?
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Hi,
I am creating a Winword document from a C++/MFC program and I need to lock the document so that the user can't change it afterwards. I have used the following code but it doesnt work. Anyone have any ideas what I am doing wrong?
TIA
Documents oDocs;
//Optional param
COleVariant vOpt(DISP_E_PARAMNOTFOUND, VT_ERROR);
oDocs = m_wordApp.GetDocuments();
m_document = oDocs.Add(vOpt, vOpt, vOpt, vOpt);
m_document.Activate();
// Then later...
COleVariant pw(pszPassword);
VARIANT v;
VariantClear(&v);
v.vt = VT_BOOL;
v.boolVal = FALSE;
// wdAllowOnlyReading appers to have a value 3 so thats what I use
m_document.Protect(3, &v, pw);
|
|
|
|
|
softwaremonkey wrote: ...change it afterwards.
After what?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thats spooky! It says I wrote "Change it afterwards". I have no idea what happened there.
Incidentally I am calling Protect as the last thing before saving the document.
|
|
|
|
|
I'm still unclear as to what you are asking. Are you wanting to password-protect a Word document?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry,
My application automatically generates a calibration sheet as a Word document which I need to make read only so that users can print it but cannot modify anything afterwards.
The automation API (if you can call it that) exposes the dcoument.Protect() method which works if I create a Word macro, but when I call it from my app, there is no error but it doesnt protect the document.
Hope that this makes more sense.
Thanks
Tony
|
|
|
|
|
I think I have solved this one. Protection is lost when the document is saved usin the SaveAs() method.
The solution was to use SaveAs(), then call Protect(), then call Save(). A little cumbersome but it works.
Thanks anyway.
|
|
|
|
|
Hey all...
I need to hide my standard output(Command prompt) while executing the exe..
I'm making a program which takes one parameter(URL) and start download(If available) in command prompt only..
I want to redirect tht particular output in my richTextBox and while writing to richTextBox i don't want command prompt to come..
Is it possible??
Seeking For Reply..
Thnks in advance..
Rock On \m/
|
|
|
|
|
I've not ever tried it, but can your make your console window a child of a hidden window?
If you are just downloading a URL in the background, what about creating a Win32 application having no window?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thnks for replying..
I'm not downloading URL..I am downloading data in tht URL...
like www.xyz.com/a.exe
So it begin to download the contents necessary for a.exe..By default it shows in console...But i need same data in my richTextBox i.e my richTextBox should work like console...
Ash..
|
|
|
|
|
So you have two separate applications?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hey all..
I'm novice in VC++... Just made a program which just ping to specific URL and print the output to richtextbox using RedirectStandardOutput...
My problem is tht whenever i try to execute my exe(Release version) it rund fine but if i try in some different computer it gives following error..
".NET Framework Initialization Error
To run this application, you must first install one of the following versions of the .Net Framework:
v2.0.50515
Contact your application publisher for instructions about obtaining the appropriate version of the .Net Framework."
Hope to see reply soon..
thnks..
|
|
|
|
|
Well, I think the error message is pretty explicit isn't it ?
You need to install the .NET framework on the target machine.
|
|
|
|
|
Thnks for your quick reply..
But i believe it's already installed...
Also in some computers it just do nothing..I mean when i click on exe it do nothing and in some machine it gives tht framework error..
Any idea bout tht??
|
|
|
|
|
I think u need to install the VC redistribute package on other machines
VC Redistribute[^]
|
|
|
|
|
Hi to all,
I have some questions,
1. In which case there is need to overload 'new' & 'delete', gloabally or within a class?
2. How to check memory leak in an application developed in C/C++?
3. What is difference between a MACRO variable & const variable in C/C++? As we can pass or return const variables to/from functions, Can we do same with MACRO variable?
4. Is the 'Data Abstraction' is feature of C++? Then what do u mean by 'Data Abstraction'? Creating new data types? But we can create new data types in C using struct/union, then why 'Data Abstraction' is not feature of C?
5. Can we do the operation performed by calloc() using malloc()? Is it valid?
int *l = (int*) calloc(12, sizeof(int));
int *m = (int*) malloc(sizeof(int)*12);
6. Scope of static & global variables in an application?
Thanks in advance,
Regards,
Aniket A. Salunkhe
modified on Tuesday, February 12, 2008 7:20 AM
|
|
|
|
|
Aniket Salunkhe wrote: 1. In which case there is need to overload 'new' & 'delete', gloabally or within a class?
Rarely.
Sometimes you want to have your allocation from a special heap memory.
Aniket Salunkhe wrote: 2. How to check memory leak in an application developed in C/C++?
In debug mode, the runtime does. It uses overloaded operator new for that!
Also, there are some source-code analyzers, who try to do the same.
But in the end it comes back to the programmer knowing what he is doing.
Aniket Salunkhe wrote: 3. What is difference between a MACRO variable & const variable in C/C++? As we can pass or return const variables to/from functions, Can we do same with MACRO variable?
A Macro is something like a search & replace you can do with the text-editor. It is done by the preprocessor before the compiler runs.
The compiler only ever gets to see the de-MACROed source. So, it has no notion whatsoever about MACROS.
So, the answer your specific question is:
No, you can not pass or return a MACRO. But we might devise a MACRO that does not give a compiler error when written instead of a parameter or return type.
Aniket Salunkhe wrote: 4. Is the 'Data Abstraction' is feature of C++?
I have no idea where you got that term from.
after reading wikipedia[^], I think you maybe mean abstract base classes?
Aniket Salunkhe wrote: Then what do u mean by 'Data Abstraction'? Creating new data types? But we can create new data types in C using struct/union, then why 'Data Abstraction' is not feature of C?
Because C does not explicitly have it as a feature?
Remenber, whil C++ can be expressed as C, C in turn can be expressed as machine language. Yet no one will call machine language abstract.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Thanks for the reply
|
|
|
|
|
Hi, I have some answers perhaps.
1. You would override the global new and delete operatos if yuo wanted to use your own heap memory manager rather than the one in the C Runtime for all memory management in your process. C# does this to implement 'managed memory' for you.
You would override the new and delete operators within a class if you wanted to implement some special allocation scheme for instances of that class or to selectively make it use your own memory manager.
2. Log every allocation with a unique number and every deallocation with a matching number. One cancels the other, anything left at the end is a leak. Sounds simple but not easy in practice.
3. MACROs dont declare variables they do the equivalent of #define wordy SomethingElse. Unless SomethingElse is also validly decalred you can't use wordy as a variable.
4. What C++ can do that C can't is 'data hiding'. Declaring private or protected members in a class anf=d then giving access to them only through, for example, Get and Set functions. This allows you to error check and trace all accesses and potentially to change the underlying name or even type of the member without breaking any other code as long as the accessors still work and have the same signatures everything is
5. Yes, just remember to use the matching version of free.
6. global variables are global, enough said. Class statics are global but their names are class specific, so CAButton::s_MyStaticMember is refered to as such and does not clash with CAScroller::s_MyStaticMember which is a compleely different variable. C++ initializes statics using some Compiler/Linker trickery and bits bootstrap code in the CRuntime which can be a bit messy.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
3. Is there any difference in #define MAX 30 & const int max=30;?
5. How to use free in that case?
|
|
|
|
|
Aniket Salunkhe wrote: 3. Is there any difference in #define MAX 30 & const int max=30;?
Yes. #define MAX 30 just replaces each occurance of MAX in the code with 30 before it's compiled, const int max=30; declares a variable which will exist at runtime. In the first case int* pInt = &MAX; would give a compiler error in the second int* pInt = &max would be fine.
Aniket Salunkhe wrote: 5. How to use free in that case?
I can't honestly remember, it's years since I used calloc in anger. You'll need to either look at the docs or in the MS C Runtime source which ships as an optional install component with Visual Studio. Every memory allocation function e.g. malloc, calloc, has a specific matching from of free and it's especially important to match them up in Debug builds where they get mapped to diagnostic versions of the functions otherwise you'll get spurious leak reports and heap damaged block reports from the allocation tracking that is added to the debug functions. The CRT memory functions are a tangled multilayer mess, especially in Debug builds and it's not easy to track down the causes of problems after they've occured.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thank You Very Much
|
|
|
|
|
dear all
after i followed the book what it explained us how to use set left and right, but however after i set it, still problem. anyone can tell me detail, thanks
#include <iomanip>
using std::left;
using std::right;
using std::cout;
using std::endl;
for example: cout <<left<<name<<endl;
Li Zhiyuan
|
|
|
|