|
|
Hi. I'm using Visual Studio 2005 C++/CLI. I have setup my application to print a document (basically the screen). I had to set the e-Graphics->PageScale = 0.85 to get the screen to fit the page, but I need to have every page be of Landscape orientation. I have tried this->printDocument->PrinterSettings->DefaultPageSettings->Landscape = true and this->printDialog->PrinterSettings->DefaultPageSettings->Landscape = true (and some slight variations) but the document is always printed as set in the print dialog (which defaults to Landscape - Portrait). Is it because there are more than one printer on our network? Do I have to read the array list of InstalledPrinters and determine which one I am using and change the orientation that way?
Thanks,
Buck
|
|
|
|
|
Answer to my own question. It is this->printDocument->DefaultPageSettings->Landscape = true before calling the printDialog->ShowDialog();
|
|
|
|
|
Dear All,
I am developing an application for decoding MPEG streams using DirectShow in VC++ Windows Application forms. Now I have connected all the pins of the filters after creating the graph. I want to run the graph, when I call pControl->Run(), a movie window will be created automatically and plays the movie. Instead of playing in automatically created window, I want to play the movie in the window created by me, bcoz I need to specify the size of the window and to have the full control of the playing window.
I have tried this in MFC and it is working fine by creating my own class and inheriting the CWnd class and using the CreateEX method to create the window. The problem is I dont know how to create the same window using VC++ Windows forms application. Please kindly advice.
Many thanks in advance.
|
|
|
|
|
bhanu_8509 wrote: The problem is I dont know how to create the same window using VC++ Windows forms application.
Maybe the NativeWindow Class[^] will help...
May be some useful info here too:
Interop (How Do I in Visual C++)[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi,
can u tell me how to connect database to .net windows form application
Thank you,
|
|
|
|
|
|
hi,
thanks for reply.
I am using MSAccess. can you give me some example links, i couldn,t understand.
Thanks again,
|
|
|
|
|
rose196 wrote: can you give me some example links
No, I can't.
If you do some research (starting at that link), you'll see there's many methods
available for accessing databases from C++. Each has pros and cons.
Choose a method, learn how it works, then I can maybe help.
ADO.NET is probably the easiest to get started with in managed code, but
even explaining ADO.NET here is a bit much to ask.
You'll find tons of working sample code in the documentation.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
rose196 wrote: how to connect database to .net windows form application
Try googling, or doing a search on this site. www.connectionstrings.com[^] is also very helpful.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello guys,
I want to read the content of a textbox (a path) and then edit a file at this path.
The type of textbox->Text is System::String^ but file manipulating functions all need char* type parameters. How can I cast the text of the textbox into a char* variable, or are there newer functions than fopen(), fprintf() and so on, which work with managed type variables?
Thanks and best wishes,
Manfred
|
|
|
|
|
Hi,
in .NET you can do most of not all text processing using the String type; have a look at
the File and/or FileInfo classes.
|
|
|
|
|
array<wchar_t>^ szArray = strPath->ToCharArray();
char buffer[50]={0};
int i = 0;
for each(wchar_t ch in szArray)
buffer[i++] = ch;
Nigah M Manzoor
|
|
|
|
|
Thanks, it's working now
|
|
|
|
|
It is giving an error undeclared identifier i dont know why ?
I am making Win32 Window through WINAPI , WNDPROC, WNDCLASSEX now, in
WNDCLASSEX structure i have define "static LPCTSTR szAppName= L"OFWin""
WindowClass.lpszClassName= szAppName;
So wat to do in order to resolve it. ?
Headers windows.h is included.
|
|
|
|
|
Why is the compiler looking for "OFWin" as an identifier when
"OFWin" is characters in a string?
This compiles for me:
static LPCTSTR szAppName= _T("OFWin");
WNDCLASSEX wce;
wce.lpszClassName = szAppName;
Also...
static LPCTSTR szAppName= L"OFWin";
should be
static LPCTSTR szAppName= _T("OFWin");
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am using Visual c++ NEt 2005, I need to set the title of my DataGridView when I printed it using gridDrawer dll but I can't.
Who have try to put a title to his printed DataGridView using GridDrawer dll. I need help
|
|
|
|
|
If you are talking about the Article here on CodeProject you should ask the question in the forum at the bottom of the article.
led mike
|
|
|
|
|
Can i use a beforeNavigate2 event with a webbrowser form contorl?
I have two forms with webbrowser controls. When I click on a link in webrowser1, the page should be displayed in webBrowser2.
to do this i wish to use beforenavigate2 to cancel the request and then use the url to open in webBrowser2.
How can I accoplish this?
|
|
|
|
|
Hi. I'm using Visual Studio 2005 C++/CLI. I have a file that has its contents read into an array, one line of the file per element of the array. There may be 10 elements to read or 10,000 elements to read. I would like to define the array size dynamically by reading each line of the file, counting until all the lines are read. Then I want to go back to the begining of the stream but there is no Seek() function. I tried streamReader->Close() and then another streamReader = gcnew StramReader(fileStream) but that doesn't work. Can I reset the streamReader back to the beginning?
Thanks
Buck
|
|
|
|
|
I think you can access the Seek method through the StreamReader's BaseStream property. I'm not by a C++ compiler so I can't test this.
Try this out:
FileStream* fs = new FileStream(S"YourFile.txt", FileMode::???, FileAccess::???);
StreamReader* sr = new StreamReader(fs);
sr->BaseStream->Seek(0, SeekOrigin::Begin);
I think you will also need to call sr->DiscardBufferedData() after the Seek or you will get unexpected results.
|
|
|
|
|
Thanks Robert,
Yes, that works.
The key here is the sr->DiscardBufferedData() otherwise the sr->BaseStream->Seek() function does nothing.
Buck
|
|
|
|
|
Hello guys,
I'm trying to execute a *.exe file from an own win api. Of course I looked through the internet but all i could find was ShellExecute() and CreateProcess() which, for any reason, don't work in VC++2008. Do I need to include any special library files or headers to get access to these functions, or is there another way to start a program from my win api?
Thanks ans best wishes,
Manfred
|
|
|
|
|
Hi,
if you want to create a process, maybe you should read up on the Process class?
|
|
|
|
|
Austrian_Programmer wrote: Do I need to include any special library files or headers to get access to these functions
ShellExecute()
Header - shellapi.h
Import library - shell32.lib
CreateProcess()
Header - Declared in Winbase.h; include Windows.h.
Library - Use Kernel32.lib.
|
|
|
|