|
Yeah, the program called Visual Studio. Just press F7 in it
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
LOL, that's exactly what I thought
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
[edit]N/m, DEFAULT_GUI_FONT works, although SYSTEM_FONT doesn't for some reason. [/edit]
I'm baffled.
I have a scenario like this:
I have a splitter window. One pane contains a window, written by me, which itself hosts two windows - one list control and one window written by me. It's in this last window my problems occur.
In the WM_PAINT handler I do the usual CPaintDC dc(*this) and then I get on with the actual drawing. I want to draw some text (using DrawText ) using the default gui font. So i HFONT hOldFont = dc.SelectObject((HFONT)GetStockObject(DEFAULT_GUI_FONT)) . But guess what? It's not the default gui font (Tahoma)! It's that damn fixed font. I also tried with SYSTEM_FONT to no avail. I did try OEM_FIXED_FONT which gave me Courier which seems ok according to the MSDN docs. GetStockObject() does not return NULL. I'm stumped! Have I missed some initialization, window style, window class style, or something?
--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
|
|
|
|
|
It seems as if I posted this in the wrong forum, but I think it's in the right forum. I think the error is related to windows in general, not the toolkit.
--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
|
|
|
|
|
I get weird results from this code:
void CGDlg::OnButton1()
{
WIN32_FIND_DATA wfd;
HANDLE hRes = FindFirstFile("C:\\Documents and Settings\\dator19\\Skrivbord\\MUMMEL\\*.txt", &wfd);
BOOL bOk = (hRes != INVALID_HANDLE_VALUE);
while(bOk)
{
bOk = FindNextFile(hRes, &wfd);
m_ListBox1.AddString(wfd.cFileName);
}
}
I have 4 files (1.txt, 2.txt, 3.txt and 4.txt) in the directory but when I show the filnames in a listbox (m_ListBox1) the output is:
2.txt
3.txt
4.txt
4.txt
Hmm... what is wrong!
It should be:
1.txt
2.txt
3.txt
4.txt
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
FindFirstFile actually gives you a file - you need to add that to your list, too.
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
That fixed one bug... but it still print out the last file two times;
1.txt
2.txt
3.txt
4.txt
<code>4.txt <-- Damn %¤#"¤#¤&!!!</code>
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Try reversing the code in the while block
while(bOk)
{
m_ListBox1.AddString(wfd.cFileName);
bOk = FindNextFile(hRes, &wfd);
}
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
John Simmons / outlaw programmer wrote:
Try reversing the code in the while block
YES!!
Thanks!
void CGDlg::OnButton1()
{
WIN32_FIND_DATA wfd;
HANDLE hRes = FindFirstFile("C:\\Documents and Settings\\dator19\\Skrivbord\\MUMMEL\\*.txt", &wfd);
BOOL bOk = (hRes != INVALID_HANDLE_VALUE);
while(bOk)
{
m_ListBox1.AddString(wfd.cFileName);
bOk = FindNextFile(hRes, &wfd);
}
}
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
May I ask one more question: If I change to *.* instead of *.txt it adds .. and ... into the listbox. What's that?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
current and parent folders.
you should add this check:
if ((findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)==FILE_ATTRIBUTE_DIRECTORY)
{
skip it
}
a working example:
http://www.codeproject.com/file/sadirread.asp[^]
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
You're calling FindNextFile too soon.
--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
|
|
|
|
|
Hello !!!
I want to(ok i have to...)make a simulator for a operating system.Can anyone help me with this?Any resources code or something else will help me, thanks.
|
|
|
|
|
What exactly do you mean?
For example if you want to run Linux in Windows you can install something like VMachine. It will take some of your HD, say 2Gig. Then you can run VMachine in a window and install Linux to it. Meaning you boot windows, work inside it. Then if you want to run Linux, you open the VMachine window and have a fresh new computer inside the window to run your Linux environment.
We used this to test a Corparate web page on Windows 95/98/ME/2000/XP on one machine, and various Linux on another.
Is this something like what you need or am I completely off base?
|
|
|
|
|
I have some shell extension which splits the filename(s).
I use _tsplitpaht(..) API and have this error:
for Release MinSize/MinDependency configuration
while _tsplitpaht(..) is in use
I get this Linkage error message:
Linking...
Creating library ../CopyFilePath.lib
and object ../CopyFilePath.exp
LIBCMT.lib(crt0.obj) : error LNK2001:
unresolved external symbol _main
../CopyFilePath.dll : fatal error LNK1120:
1 unresolved externals
Error executing link.exe.
while commenting _tsplitpath(..) I get no error msg.
for Debug configuration
while _tsplitpaht(..) is in use I get NO error msg
Any ideas
|
|
|
|
|
Read the docs on LNK2001, or the VC forum FAQ. This problem is explained in both places.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hello.
I have an application which plays wmv-files. This is the code that runs when the play button is clicked:
IGraphBuilder* m_pGraph;<br />
IVideoWindow* m_pVidWin;<br />
IMediaEventEx* m_pEvent;<br />
IMediaControl* m_pMediaControl;<br />
<br />
USES_CONVERSION; <br />
CoCreateInstance(CLSID_FilterGraph, NULL,<br />
CLSCTX_INPROC,IID_IGraphBuilder, (void **)&m_pGraph);<br />
m_pGraph->RenderFile(A2W(m_strVideoFile),NULL);<br />
m_pGraph->QueryInterface(IID_IVideoWindow, (void **)&m_pVidWin); <br />
<br />
m_pVidWin->put_Owner((OAHWND)this->GetSafeHwnd()); <br />
m_pVidWin->put_WindowStyle(WS_CHILD); <br />
<br />
m_pGraph->QueryInterface(IID_IMediaEventEx, (void **)&m_pEvent); <br />
m_pEvent->SetNotifyWindow((OAHWND)this->GetSafeHwnd(),WM_GRAPHNOTIFY, 0); <br />
<br />
m_pGraph->QueryInterface(IID_IMediaControl, (void **)&m_pMediaControl); <br />
m_pVidWin->SetWindowPosition(XMARG,YMARG,iWidth,iHeight);<br />
m_pVidWin->put_Visible (OATRUE); <br />
m_pMediaControl->Run();
There is one problem with this code. The first time the button is clicked the movie is not played but tha second and third time it works fine. Does anybody have any idea on what is wrong? Any help would be very appriciated.
/Charlie.
|
|
|
|
|
I want to load text, that i drawn in a window, in Memory and then bitblt it in a bitmap. Can any one tell me how OR give me the link of any such sample program.
Thanks
|
|
|
|
|
If you have already drawn the text to the window, then all that you need to do is call ::GetDC in order to get a device context to that window, and create a MemoryDevice context to blit the data to.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Now that North Korea is threatening the US with "bitter defeat and death", I suppose we'll finally see if the war in Iraq is really about disarming threats to US, or simply freeing up the land for the fabled oil pipline as some claim. Presently North Korea seems to be a greater threat to the US than Iraq, who is at least feinging coperation. What will the US and its allies do?
My guess is that Iraq and North Korea are in cahoots, and North Korea is just blowing smoke to get the US's attention off Iraq. Why else would a seemingly insignificant little country with a couple of nukes be standing up and boasting so loudly like the c**k-of-the-walk against one of the largest military forces in the world? My other guess is that maybe N. Korea figures the US is too busy with Iraq to do anything about it and is just shouting "mlah, mlah, mlah!" like a little brat from the sidelines.
My third guess is that the US actually may end up carpet bombing N. Korea if they try anything stupid, and then move on the way you turn to bigger threats after swatting a mosiquito. I'm not saying that's right, I'm just guessing. The US has shown tremendous restraint after September 11. These rogue nations better not push their luck.
On another note, there have been a lot of anti-war protestors in the US lately. "Stop the war, stop the war!" they cry. What will they be saying after N. Korea suddenly delivers their brand of bitter defeat and death, or even attempts to? It's like the abused wife who suddenly attacks the cops when they come to arrest her husband.
"My brother says 'Hello'... So hurray for speech therapy!" -Emo Phillips
|
|
|
|
|
This topic belongs in the Soapbox.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Sorry. Somehow this ended up in the C++ forum. I didn't notice.
"My brother says 'Hello'... So hurray for speech therapy!" -Emo Phillips
|
|
|
|
|
Michael Dunn wrote:
This topic belongs in the Soapbox.
Here's a funny thing. I run several CP windows open in the morning as I catch up, so I saw this at the top, responded to it, and then thought 'what are all these programming questions doing in the soapbox ?'.
Christian
P.S. Although I love helping people through the CP message boards, the amount of abuse I have copped in recent times forces me to adopt a policy where I will only answer questions put to me through the boards. It is also to your benefit to ask on the site, I don't know half of everything, and a publically posted question will get you more than one person trying to help. I would especially prefer to live in a world where no-one ever sends me a zipped project with instructions on wh
|
|
|
|
|
Christian Graus wrote:
'what are all these programming questions doing in the soapbox ?'.
ROTFLOL
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
I thought the same thing, when Micheal told me to put it in the soapbox. I thought "I wonder why people are answering programming questions in the lounge."
"My brother says 'Hello'... So hurray for speech therapy!" -Emo Phillips
|
|
|
|