|
Your idea of creating a hidden window from the DLL is the right way to do this.
|
|
|
|
|
thanks a lot.
- tareq
of all the things i've lost, i miss my mind the most
|
|
|
|
|
I know it's not VC++ but I'm trying to capture video with my camera and i'm using the vfw.h header file. After I got done adding the functions that were not in the header (Using MSDN Library) i tried to compile the program but i get a link error with undefined references to the functions i added. I looked all over the internet to find out why i would get the link error, but it still won't work even after doing what some pages said. Can anyone help me with this problem?
Thanks in advance,
me...;P
|
|
|
|
|
If you have the source, you should add those cpp files to the project, else you'd have to add a lib (or multiple libs as the case might be) to your linker's additional library list.
|
|
|
|
|
Nishant Sivakumar wrote: If you have the source, you should add those cpp files to the project, else you'd have to add a lib (or multiple libs as the case might be) to your linker's additional library list.
Hey,
Thank you for you answer, unfortunately it is still not working. I'm going to try one more thing and hopefully it will work.
|
|
|
|
|
not really a vc++ question, but I want to know what is the fastest way to convert the unix-style line ends (cr/lf) with the dos style (cr) for a bunch of files?
thanks!
|
|
|
|
|
Sphere ++ wrote: unix-style line ends (cr/lf)
"Unix line ending" is only LF, "Windows line ending" is CR + LF and "Mac OS line ending" is CR.
--
The Blog: Bits and Pieces
|
|
|
|
|
you are right, thanks for the correction. Any suggestions for a batch conversion?
thanks!
|
|
|
|
|
Do you want to program it yourself or do the one-time job? If first, you will have to copy files line by lines, I don't see any special tricks to do it faster. If you just need the job done, get one of converter from internet and make a batch file using "for" command.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
I did this conversion years ago, but since I did not have too many files, I just read from the source file and wrote to destination file, character by character, replacing LF (??) with CR LF (??).
The reason for character-by-character rather than line-by-line is that I also converted DOS-style line-drawing characters to 7-bit ASCII ("-", "|", "+", etc.) which Windows was happy with.
I seem to remember that some OS-2 files used LF CR instead of CR LF, which confused Windows (or maybe WinWord 6), so I fixed those as well.
My app was a 16-bit DOS app, using VC1.52!
|
|
|
|
|
I need to create a control dynamicly and then get its DC to draw text and so on,just do as the following code:
BOOL bCreate = m_hEdit.Create(WS_CHILD | WS_TABSTOP | WS_VISIBLE |ES_LEFT , rectEdit,this, IDC_COMBOTREE_EDIT);
if (bCreate)
{
CWnd* pParent = GetParent ();
CFont* pFont = pParent->GetFont ();
m_hEdit.SetFont (pFont);
}
CDC *dc=m_hEdit.GetDC();
dc->DrawTextW(_T("ok"),-1,CRect(0,0,30,20),DT_LEFT);
dc->SetBkColor(RGB(0,0,0));
m_hEdit.ReleaseDC(dc);
but it doesn't work,I can never see the "ok" in the edit.
Any help is appricited.
Thanks!
para
|
|
|
|
|
Can you use SetWindowText since its an edit window?
|
|
|
|
|
Thank u , but this method can't draw the text in the edit contol.
|
|
|
|
|
paraGOD wrote: Thank u , but this method can't draw the text in the edit contol.
SetWindowText() *can* draw the text in the edit-ctrl.
In fact, its the only way to do it this side from owner-drawing the whole control.
Your way paints the text at the exact place where the Edit-ctrl is located, triggering the edit-ctrls redraw.
Your text gets overwritten.
If what you want to acomplish is putting your Text into the Edit-ctrl, then SetWindowText() is the way to tell the Edit-ctrl what text it has to draw.
If you want something different, you should subclass CEdit and do it yourself, possibly delegating routine tasks to your baseclass CEdit.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hi, I was trying to make a dice app in VC++ 98 for me and my friends to play DnD.
I want the ability to throw the same dice multiple times on a push of the button.
This is what I have come up with:
<br />
void CZmurfDICEDlg::OnD20() <br />
{<br />
int ret;<br />
for(int k=0; k < m_E20; k++)
{<br />
UpdateData(TRUE);<br />
m_strET="";
srand((unsigned)clock());<br />
ret=rand()%20+1;<br />
m_strET.Format("%d ",ret);<br />
m_strMessage=m_strMessage+m_strET;
}<br />
UpdateData(FALSE);<br />
}<br />
If I set 20 into m_E20 and push the button for D20, I only get one result, not 20 as I want to.
Any help is more that welcomed
Thanks, Bogdan
|
|
|
|
|
You're appending the m_strET value to m_strMessage . Is this the member variable displayed in the dialog, or is it m_strET ? If it's the latter, that would explain why you only see one value.
Software Zen: delete this;
|
|
|
|
|
m_strMessage is the editbox that the user can see. m_strET is not visible, I use it as a temp.
I have found out by updating m_E20, so I can see what happens, and adding this to the code right bedore the "}" of my for: m_E20--;
I set the value in m_E20 to 10, as to have 10 throws, but when I push the button the value in m_E20 becomes 9; so it throws the dice only 1 time, not 10 times
Thanks, BF
|
|
|
|
|
I think I've figured it out. Here's your original code:
void CZmurfDICEDlg::OnD20()
{
int ret;
for(int k=0; k < m_E20; k++)
{
UpdateData(TRUE);
m_strET="";
srand((unsigned)clock());
ret=rand()%20+1;
m_strET.Format("%d ",ret);
m_strMessage=m_strMessage+m_strET;
}
UpdateData(FALSE);
} Calling UpdateData(TRUE) inside the loop resets all of the member values to whatever is on the screen, which clears out what you've been calculating in the loop. Also, you don't need to seed the random number generator each iteration of the loop. Try this instead:
void CZmurfDICEDlg::OnD20()
{
int ret;
UpdateData(TRUE);
srand((unsigned)clock());
m_strMessage="";
for(int k=0; k < m_E20; k++)
{
m_strET="";
ret=rand()%20+1;
m_strET.Format("%d ",ret);
m_strMessage=m_strMessage+m_strET;
}
UpdateData(FALSE);
} Using this logic, m_strET will display the last value calculated, and m_strMessage should display the list.
Software Zen: delete this;
|
|
|
|
|
Just as a side note: When you are posting more than one line of code, you can use the <pre>...</pre> tags to format it. It makes the code a lot easier to read. I think that's why I didn't notice the UpdateData(TRUE) call inside the loop before.
Software Zen: delete this;
|
|
|
|
|
Thanks a lot, that was it
Cheers, BF
|
|
|
|
|
|
You have to move the statement UpdateData(TRUE); outside the for loop. The value of the variable m_E20 is not updated when you come to the for loop. So the loop does not get executed.
So the correct way is
UpdateData(TRUE);
for(int k=0; k < m_E20; k++)
{<br />
m_strET="";
-----<br />
}<br />
UpdateData(FALSE);
|
|
|
|
|
Hi,
I want to use ST_SplitterWnd (http://www.codeproject.com/splitter/st_splitterwnd.asp). The right pane should be a CFrameWnd with a DialogBar and some views. Attached to the Dialog Bar is a CTabCtrl for switching between the views in the CFrameWnd. The problem now is, that a small part of one of the views is visible within the first view at the left upper corner.
When showing the other views (by clicking at the appropriate tab) and then going to the first view again, the problem is gone.
When I use a standard CSplitterWnd I don't have this effect.
What's wrong?
Thank's
#9370
-- modified at 7:41 Sunday 13th November, 2005
|
|
|
|
|
Off-hand, it sounds like an initial background painting problem.
You would probably be better off posting a message in the article's forum, since it sounds like a problem related to the article code.
Software Zen: delete this;
|
|
|
|
|
Hi Gary,
thank you for your reply but I already tried it in the article's forum - I got no answer yet.
#9370
|
|
|
|