|
I need urgent help!
I have no idea whats wrong with the program and I need it working with the given printer this week!
Even if you can give me a smallest tip, please, write me.
Thanks a lot!
|
|
|
|
|
Hello everyone,
My question is how to change the font color of slide.
I have Automated PowerPoint Using Visual C++ MFC,such as:
_Application app;
Presentations presentations;
_Presentation presentation;
Slides slides;
_Slide slide;
ShapeRange shaperange;
Shapes shapes;
Shape shape;
TextFrame textframe;
TextRange textrange;
Font font;
FillFormat fillformat;
ColorFormat colorformat;
ShadowFormat shadow;
if(!app.CreateDispatch("Powerpoint.Application", &e))
{
CString str;
str.Format("CreateDispatch() failed w/err 0x%08lx", e.m_sc),
AfxMessageBox(str, MB_SETFOREGROUND);
return;
}
app.SetVisible(TRUE); Presentations presSet(app.GetPresentations());
_Presentation pres(presSet.Add(TRUE));
Slides slideSet(pres.GetSlides());
_Slide slide1(slideSet.Add(1, 2));
// Add text to slide, by navigating the slide as follows:
// slide1.shapes(#).TextFrame.TextRange.Text
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)1)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("My first slide");
}
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)2)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("Automating PowerPoint is easy\r\n"
"Using Visual C++ is powerful!");
font = textrange.GetFont();
font.SetName("Comic Sans MS"); //Set the font name.
font.SetSize((float)48);
}
Now the question is how to change the font color????
Help me,please!!
Thanks a lot!!;P
cengyikun
|
|
|
|
|
Hi everyone, I am a new comer.
I want to ask if it is possible to write a directsound application without using GUI such as window dialog and MFC? Because I found that every sample provided by the DXSDK is written with window dialog? I wonder if I can create a application by using "Console Application".
Thank you everyone!!;)
|
|
|
|
|
There is no reason why you could not take appropriate functions from the examples and implement them in a console based application if that is what you want.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
But I encounter the following errors when I build the application:
fatal error C1010: unexpected end of file while looking for precompiled header directive
I am using .Net platform and creating this project by choosing the C++ console application.
Below is my code:
#include "stdafx.h"
#include "dxstdafx.h"
#include <commdlg.h>
#include <dsound.h>
int _tmain(int argc, _TCHAR* argv[])
{
HWND hDlg;
CSoundManager* g_pSoundManager = NULL;
if (FAILED(g_pSoundManager->Initialize(hDlg,DSSCL_PRIORITY)))
{
printf("FAILED");
}
return 0;
}
Since I am using console application , I don't know what to put for the HWND variable for the Initialize function.
And I found that the problem only exist when i add the DXUT.h, DXUT.cpp, DXUTsound.cpp, DXUTsound.h provided by the DXSDK sample.
Which .cpp or .h should be added to succeed?
Thank you for replying.
|
|
|
|
|
You need to disable precompiled header for the file who generates the error:
in the workspace, left click on the concerned file, then choose Settings -> C/C++ tab, then choose 'Precompiled Header' category and select 'Not using precompiled header'.
In fact this for VC6 but it must be something similar in .NET.
|
|
|
|
|
Thank you for your reply but I still can't build it successfully.
Can you tell me what must I do to start programming direct sound with console application, such as which .h files should be added.
Thank you.
|
|
|
|
|
Sobero wrote:
Thank you for your reply but I still can't build it successfully.
Yes but what is the error ?? Why can't you build your application ?
|
|
|
|
|
This is my code now:
#include "stdafx.h"
#include "dsound.h"
int main()
{
CSoundManager* g_pSoundManager = NULL;
return 0;
}
error C2065: 'CSoundManager' : undeclared identifier
error C2065: 'g_pSoundManager' : undeclared identifier
I have added the dsound.h in the solutino explorer, and link the dxsdk include and lib folder to the project.
Is the project still missing some .h or .cpp?
Thank you very much!
|
|
|
|
|
Where is the class CSoundManager declared ?
You have to include this file in the main file
|
|
|
|
|
Now, I have included the .h and .cpp files into the workspace.
However, the new added files cause the following error:
Capture fatal error C1010: unexpected end of file while looking for precompiled header directive
I have set the corresponding file to not use precomiled header,
but this cause the link error:
Capture error LNK2001: unresolved external symbol _IID_IDirectSound3DBuffer
What's wrong with my code?
#include "stdafx.h"
#include "dsound.h"
#include "dxstdafx.h"
#include "DXUTsound.h"
int main()
{
CSoundManager* g_pSoundManager = NULL; return 0;
}
Thanks again!
|
|
|
|
|
Did you clean then recompile after you change the project setting not to use pre-compiled headers?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I have tried it but the problems still exist.
Maybe I send my project to you to see what are the errors.
|
|
|
|
|
Make sure also all the required libraries are included in your project (for example the library where _IID_IDirectSound3DBuffer is defined) !
You have to add these files in 'Project -> Settings' / 'Link' Tab and insert them in 'Object/library modules'.
This is probably why it throws the error: you included the .h files but the definition of the symbol is missing because it is defined in an external library (*.lib file).
|
|
|
|
|
Also , when i call the g_SoundManager->Initialize() function, I have to pass
the HWND parameter into this function. But I am using console application,
so, what should I pass for the HWND variable?
Console error LNK2019: unresolved external symbol "public: long __thiscall CSoundManager::Initialize(struct HWND__ *,unsigned long)" (?Initialize@CSoundManager@@QAEJPAUHWND__@@K@Z) referenced in function _wmain
Thank You!!
|
|
|
|
|
I think it is missing required Library file
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
No this error comes because the Initialize function is not defined it has not been found in any library included). Make sure this library is included in your project !! (Take a look at the documentation to see which library you need to include).
Second, if your function require a HWND parameter, I don't know if this will work if you pass nothing to it (did the function accept a NULL parameter ?). Take a look at the documentation to see if this can work (I never worked with it so I don't know).
|
|
|
|
|
Hi
all
Our project is in VC++ and in this project we are generating Crystal report(Version 10) using XML file and the XML driver we are using is CRXML 4.2.
Problem is when we instal our project in client PC (there crystal report V10 is not installed) but while instaling our project we are regeistering all depended dlls like cexml19.dll,crxml19s.dll etc. But it not registering in client PC. We are not getting report.
Please any one help me to come out of this problem.
Arun
|
|
|
|
|
What installer are you using. Crystal provide merge modules (.msm) files for their system. They can be used directly in products such as InstallShield.
Given that you add all Crystal (.msm) modules that you are using the client PC ought to be able to show your reports.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi
Ant
Thank you for your reply.
I think Crystal merge modules are for .NET applications. Ours is VC++ V6 but i don't know much about this merge module.
In install shield we followed the steps that is specified in the link gineb below.
http://support.businessobjects.com/library/kbase/articles/c2014906.asp
Thank U
Arun.
|
|
|
|
|
hi all,
I want to get the List of running applications in the Desktop.
In the TaskManager--->Application there is a list of running applcations..
So how do I get that list using C++?
Thanks in advance..
|
|
|
|
|
USE these api
CreateToolhelp32Snapshot to get handle for PROCESS
then use Process32First & Process32Next to enumerate the process.
MSDN reference of Process32First contain a example for your need
Or you can browse CP/MFC&Visual c++/Thread and process section for more example
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi
Can I load an icon file (.ico) from file during runtime? If yes, how can I display the icon on the screen? If no, a bitmap will be loaded. Then can I set the background of the bitmap transparent? And how to do this?
Thanks
|
|
|
|
|
USe LoadBitmap API to load ICON,BITMAP at runtime
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks for answering.
HBITMAP LoadBitmap(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpBitmapName // name of bitmap resource
);
If I load the ico file at runtime, is that input the file path and file name of the ico file to the the second parameter?
Thanks
|
|
|
|