|
knapak wrote: Yeah that works... I was wondering if there was a direct way to format the output in columns.
If you are not worried about portability issues, you can use SetConsoleCursorPosition
-- modified at 17:16 Thursday 15th December, 2005
|
|
|
|
|
Can you explain? Portability? How do you use SetConsoleCursurPosition? I'm writing to a file not sending out to console.
Thanks
|
|
|
|
|
knapak wrote: Can you explain? Portability? How do you use SetConsoleCursurPosition? I'm writing to a file not sending out to console.
Oops, ignore my post then
|
|
|
|
|
the endl that you are outputting after every number is what causes the newline to be output. Just control when you output an endl .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
So far, I did it by setting the initial dir to be C:\ and then sending a virtual click to "Up One Level" button. Do we have any better ways to do that? I think it should have some special string so that CFileDialog could understand and start the dialog with "My Computer" as its initial directory. Unfortunately, I've not found it yet! Please help me.
Thanks in advance.
|
|
|
|
|
Set the initial directory to ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
CFileDialog f(TRUE);
f.m_ofn.lpstrInitialDir = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
f.DoModal();
|
|
|
|
|
I truly appreciate your help.
Another thing I wonder is that whether this is documented by Microsoft. I'm testing it on previous version of Windows (NT, 9x). Will it be changed in the future?
Thanks so much.
|
|
|
|
|
That CLSID has resolved to 'My Computer' since Windows 95. I see no reason for it to change in the future.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I am not sure of Vista, but it should work the same in 98, 2000, XP and 2003.
|
|
|
|
|
I am developing a web service application using ASP.NET and the MS WSE (Web Service Enhancements). On the server side, there is an asmx file running on IIS wich is able to recieve a SOAP message with a DIME attachment (e.g. an *.gif).
Now I am developing a client that can send those messages with a DIME attachment.
Here's the basic method I am trying to implement:
// ***********
SoapContext *reqC = RequestSoapContext::Current;
DimeAttachment *dimeAttach = new DimeAttachment(
"image/gif", TypeFormat::MediaType,
"C:\\temp\\IMG_3621.jpg");
reqC->Attachments->Add(dimeAttach); //System.NullReferenceException???
// ************
When I am trying to build the programme, the process breaks with an exception, claiming there was a "System.NullReferenceException" (Object reference not set to an instance of an object)in the last line of code posted above.
What does that mean?
The above method is taken from a MSDN example wich is also quoted here on codeproject.com (http://www.codeproject.com/soap/DimeTest.asp). In the examples it is used as a server method (the server sends a SOAP message with a DIME attachment on client request), but I need it as a client method so I changed the SoapContext into a "RequestSoapContext" instead of a "ResponseSoapContext".
I did include all the necessary namespaces and headers, the compiler accepts all commands without throwing any errors, the error appears during build/debug.
The examples are in C# but I am not familiar with it so I need to be doing it in C++.
Thank you in advance for any hints!
P.S: I am not a native english speaker- please excuse my faults.
|
|
|
|
|
Hi,
I'm using CFileDialog and have setup the extensions etc and it seems to work correctly.
The only problem is that if a type a non existent filename into the filename text box and select open CFileDialog exits (DoModal returns IDOK).
Surely I don't have to check that the file from calling GetPathName() exists?
Cheers,
Ally
|
|
|
|
|
Why not use OFN_FILEMUSTEXIST ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thanks for that got it sorted. I knew there must be a way to do it.
|
|
|
|
|
Hi,
I tried both TB_PRESSBUTTON and WM_LBUTTONDOWN, but I failed. Do you have any ideas to solve this problem?
Thanks in advance.
|
|
|
|
|
do you need a visual feedback ?
Toolbar buttons are COMMANDS, so , you could ( never tried it ) do a SendMessage with the appropriate command ID.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I would do a PostMessage myself...
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
Hi,
I tried to send the WM_COMMAND to my toolbar, it worked. But it failed when I sent that message to the toolbar of the Open File Dialog (CFileDialog). Here is my code:
<br />
hwndToolBar = ::FindWindowEx(hwndParent, NULL, _T("ToolbarWindow32"), NULL);<br />
::SendMessage(hwndToolBar, WM_COMMAND, MAKEWPARAM((WORD)40961, CN_COMMAND), NULL);
I didn't know why it failed. Please help me. What I need is programmatically clicking on the "Up One Level" button.
Thanks in advance.
-- modified at 14:39 Thursday 15th December, 2005
|
|
|
|
|
Are you sure the FindWindowEx returns an HWND? Perhaps it returns NULL.
|
|
|
|
|
It works now. The problem is that when I send the message. It wouldn't work in WM_INITDIALOG and WM_NOTIFY (code CDN_INITDONE). It worked well in WM_NOTIFY (code CDN_SELCHANGE and probably others but I've not tested yet!)
Thanks for helping.
|
|
|
|
|
That's cool, but to be safe, you should always check if FindWindow(Ex) succeeds before using the HWND.
|
|
|
|
|
Hi,
In Win32 app...is there any way to find the Windows Monitor number programatically???
Thanks.
|
|
|
|
|
Manu_81 wrote: Windows Monitor n
What's this? Do you mean the monitor's model number?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
In multiple display monitor environment, windows assigns each monitor a monitor number 1,2,3...so on. I want to retrive that info for all the available display monitors.
Thanks.
|
|
|
|
|
How about EnumDisplayDevices() ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|