|
I'm running it on a brand new computer that I got 3 weeks ago and I installed VC++ then. Unfortunately, I don't think it has anything to do with the OS or the installation of VC++.
|
|
|
|
|
Hi,
I need to run Ms Word automated, and my idea is to add some buttons to insert the Word Doc. some controls that has some reports thing, ... I will need to insert them ( maybe just a metafile, with some little info to know some settings).
Then I would need to insert the activeX in the word doc, and set the data ( metafile, and some properties).
And I would need to iterate through the activeX controls ( or detect the focus of the ActiveX file), and retrieve some properties from it ( take it from the word instance to my current program).
Is that possible ? ( the main problem that I see, is that the ActiveX DLL is running in a different proccess than the Main Application) Thanks, Bye !
Braulio
|
|
|
|
|
Hi guys,
This is my first post in code project. I am new to Win32 Application development. I have written the following code to check for CDROM drive on computer. THe code seems alright but when I compile it, I get the following error
error C2065: 'sprintf' : undeclared identifier
I have included stdio.h but still I cannot resolve the problem. Hope someone helps me. thanks
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "stdafx.h"
int test;
UINT retval;
LPCTSTR chTest;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char ascii;
char ascTemp[80];
ascii = 'A';
while (ascii <= 'Z') {
test = sprintf(ascTemp,"%c:\\",ascii);
if (GetDriveType(ascTemp)== 1)
{
test = MessageBoxEx(NULL,"Found","ABC",NULL, NULL);
}
ascii = ascii + 1;
}
return 0;
}
|
|
|
|
|
tppradeep18 wrote:
I have included stidio.h but still I cannot resolve the problem. Hope someone helps me. thanks
Did you mean to type stdio.h ? I can't tell because you've not shown the headers, you need to check the box that says not to use HTML, your includes have been stripped because they look like tags. If you have included stdio.h, then I dunno why it's not working.
In this case sprintf is obviously OK, but overall I prefer to use ostringstream for safety.
ascii += 1 is preferred as a matter of efficiency, you save the creation of a tempory.
It's a good idea to specify global scope with the :: operator, like this ::MessageBox(etc
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
thanks graus for that instant reply.
I have editied my question. I liked the tips given by you for increasing the efficiency. I am still caught up with the error. Any more clues as to why this is happening.
|
|
|
|
|
include "stdafx.h" before including anything else i.e. move #include "stdafx.h" statement to the top and you won't get the error message
-cheers
-kashif manzoor
peace to all
|
|
|
|
|
thanks kashif. It worked. My problem is solved. thanks a lot !!!
|
|
|
|
|
#include < windows.h >
#include < tchar.h >
#include < stdio.h >
<font color=green>#define SIZE 80</font>
int test;
UINT retval;
LPCTSTR chTest;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char ascii;
char ascTemp[SIZE];
ascii = 'A';
while (ascii <= 'Z') {
<font color=green>test = _snprintf(ascTemp,SIZE,"%c:\\",ascii); </font>
if (GetDriveType(ascTemp)== DRIVE_CDROM)
{
<font color=green>_snprintf(ascTemp,SIZE,"Found CDROM %c:\\",ascii);</font>
test = MessageBoxEx(NULL, ascTemp, "CDROM Drive", MB_OK, 0);
}
++ascii;
}
return 0;
}
It works..try it. Use _snprintf instead of sprintf for bounds safety.
Atul
Sonork ID : 100.13714 netdiva
|
|
|
|
|
Hi. I am having a tough time finding a way to tell if a printer is actually connected to a computer. By knowing this, I can save it to disk instead of printing it etc. Does anyone know a good way to find out if a printer is actually connected?
|
|
|
|
|
MSDN:
The EnumPrinters function enumerates available printers, print servers, domains, or print providers.
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
Hello
I want to know if is possible to write a NT service, in a DLL (I know that some system services reside in dll's, but I don't know how could I implement myself).
What is a skeleron of such program???
Thank in advance
|
|
|
|
|
I think NT services are not in DLL,They are as EXE,but to become sure there thre are some article in CP by Brian Hart,you can check them or put message there,then Brian will answer you.
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Miguel:
I love to write NT services, I write two or tree NT services by month...
I need to say you taht Is not possible, to write a service like a dll, the service is an .exe file because the NT service manager call to the applications that are informed in HKEY_Local_Machine\System\CurrentControlSet\Services\<your service="">\ImagePath\<exe file="" name="">...
Check this and you will can see that all services in your machine are exes...
Regards...
If your computer says, "Printer out of Paper," this problem cannot be resolved by continuously clicking the "OK" button.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thanks Carlos,
I think you are clear enough.
But don't bother if I ask you again,
in another form: is no chance to have the
Service Processing function (the function
which respond to SCM and other messages)
located in a DLL?
|
|
|
|
|
Don't problem with that.
You must to have the service in a exe file, but you can make dlls to manage messages, connctions with databases, etc. You only need the main loop in a exe with the basic functions of the service, like onservicestart, onservicestop, etc. You always need to have the control of your service in a exe file, if you are using dll for make other things, is not a problem, you only need to have care with some points....;)
Regards
My software never has bugs. It just develops random features.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Carlos Antollini wrote:
You must to have the service in a exe file, but you can make dlls to manage messages, connctions with databases, etc.
Thanks a lot for your quick answer.
Was very useful for me, because make me clear
enough what I have to do.
Regards,
Miguel
|
|
|
|
|
Could anybody helps me how to call Excel math functions from VC++ ??
Especially functions with direct parameters / not parmeters from the cells /
as a
ACCRINT
POWER
etc.
Mira
|
|
|
|
|
Do you want to interact with Excel for some reason, or do you just want the functions in math.h ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
I've got the following problem, andwould be pleased to have any info or tip to solve it:
I use for my OpenGL scene texture objects which I load in the texture memory (on a Nvidia GeForce2 GTS). I'll check they are resident using glAreTexturesResident, everything is fine. The problem is when I delete these textures objects (using glDeleteTextures), and re-create others, those can't no more be loaded as resident, as if the previously ones were not freed from the texture memory, and still use the space. The consequence is the frame rate abruptly falls, logically.
If anybody has info, please help ! TIA.
K.
|
|
|
|
|
I need something about registry backup. If You someone help me with sourse where I can see new or old information about it I'll be glad very match... sanks...
|
|
|
|
|
I forget the names, but the registry is in two files, you need only to copy them somewhere.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
In win98 you can make copy of system.dat and user.dat,both of which are hidden files in the windows folder.In NT and wn2000 I think you should create an update emergency repair disk.(see your operating system doc)
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
There is a system backup tool with win98 that backs up your registry, along with a few other things, so take a look if you have win98. Or you can do it manually (system.dat, user.dat, as mentioned in the previous post).
Simon
"It's one for you, nineteen for me."
Sonork ID 100.10024
|
|
|
|
|
You can export your entire registry as a text file [.reg] and zip it. Later on, double-click it to get things back.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Hi,
I'm new to vc++ and i'm writing an application which is using propertysheets(just like the clock in the systray) and it is required to be minimized to the systray. Everything is working fine in dialog box but when it comes to CPropertySheet i couldn't find any event which i can catch and minimize my application to the systray. I tried using WM_DESTROY but of no use and i figured out(rightly or wrongly) that WM_CLOSE, WM_CANCELMODE, WM_CANCEL are not being called???
I'm in a fix and i'm not getting any answers. Any ideas????
Thanx in advance,
Rohit
Rohit
|
|
|
|
|