|
Well, first off you've got a problem in that you're passing the address of a pointer to the API, not the address of a WKSTA_INFO_100 struct. That's gonna corrupt your stack.
Once you fix that, use ATL's W2CT macro to convert from WCHARs to TCHARs, then _tcsdup to make a copy of the string.
USES_CONVERSION;
LPCTSTR pszCompName;
pszCompName = _tcsdup ( W2CT(buf.wki100_computername) );
if ( NULL == pszCompName )
free ( pszCompName );
--Mike--
"Everyone has figured out what 'service pack' really means, so they had to go and change the language. Perhaps this is what Bill was talking about in the 'security is top priority' letter."
-- Daniel Ferguson, 1/31/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Hi,
I created a MDI app with a CRicheditView.
Works fine but I'd like to modify the Richedit style, i.e. add auto horizontal scroll to avoid line wrapping.
usualy, this is done through create(style, .....).
But I can't find where the richedit is created in the MDI appwizard generated code
help !
|
|
|
|
|
Check this:
CRichEditView::GetRichEditCtrl
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
yeah, knew this one.
the problem il that I see only the SetOptions() method to change style, I tried :
GetRichEditCtrl().SetOptions(ECOOP_SET, ECO_AUTOHSCROLL |<br />
ECO_WANTRETURN | ECO_AUTOVSCROLL);
but seems to change nothing.
|
|
|
|
|
Yes,you are right ,it doesn't work.
There is MFC sample in MSDN,WORDPAD ,maybe it helps you ,I don't
have it to check it,if you find the answer in it please reply me.
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
wordpad sample does it. I just can't figure how...
<psycho scream> AAHAHAHAHAAAHAHAHAHHAHAHAHAHA </psycho scream>
I'll go to sleep, local time is 23:48.
|
|
|
|
|
I work on it a little,we have to change "wrap" property
In the example in "option" dialog box it change radio button
to no wrap but I couldn't found where it take effect,I put new message,maybe
someboddy HELP us
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
I'm looking at "Sams Teach Yourself Visual C++ 6 in 21 Days" and for the code on page 78, I get the following error for line 23's code in the book:
--------------------Configuration: Timers - Win32 Debug--------------------
Compiling...
TimersDlg.cpp
C:\WINDOWS\Desktop\Rajveer\Timers\TimersDlg.cpp(203) : error C2196: case value '1' already used
Error executing cl.exe.
TimersDlg.obj - 1 error(s), 0 warning(s)
I checked all my code for that entire project and I've typed it exactly as the book. So what is wrong?
|
|
|
|
|
Um... hard to say without seeing some code.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
hard to say without seeing some code
The operative word here is "some" I guess. I mean we dont want someone posting an entire project over here huh?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Not again.
J
|
|
|
|
|
yeah. Not so soon anyway
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Post the code snippet for the function within which you get this error.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
[ Please don't send me email - instead reply to the forum. Thanks! ]
Rajveer wrote:
Here is the function that gave the error. I have marked the line where the error occured. And i've pasted the error message below.
void CTimersDlg::OnTimer(UINT nIDEvent)
{
CTime curTime = CTime::GetCurrentTime();
switch(nIDEvent)
{
case ID_CLOCK_TIMER:
m_sTime.Format("%d:%d:%d", curTime.GetHour(), curTime.GetMinute(),
curTime.GetSecond());
break;
case ID_COUNT_TIMER: m_iCount++;
m_sCount.Format("%d", m_iCount);
break;
}
UpdateData(FALSE);
CDialog::OnTimer(nIDEvent);
} You can't have 2 cases (i.e. 2 occurences of ID_CLOCK_TIMER) in the same switch statement. Looks like you made a simple copy/paste error.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
He doesn't - he as ID_CLOCK_TIMER and ID_COUNT_TIMER but they both seem to have the same value.
A vast majority of our imports comes from outside the country.
George W. Bush
|
|
|
|
|
Ooops! Sorry, my dyslexia got the better of me.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I've just tried to use the c++ complex library in vc6, but if I use the complex template like this
complex<double> foo;
for some reason a compile error is generated:
error C2143: syntax error : missing ';' before '<'
does anyone know why this happens, how to avoid it, and why is the complex header file called "complex", and not "complex.h"?
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
insert
using namespace std; between the #include and the first use of complex .
If you don't know what std goes about, I suggest you read the "namespaces" section of any good C++ tutorial.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
try
std::complex<double> foo;
|
|
|
|
|
Hi,
I have several toolbars and control bars in my application. I load different ones depending on the type of document loaded at the time. Hence, if I close one document type and open another I get different combinations of control bars.
My problem is that when I unload the control bars they do not destroy properly, the client area (i.e. the grey panel) for the control bar remains.
Is there a key step that I have missed in the process of closing a ControlBar?
The same is also true for the toolbars underneath the menus.
Matthew
|
|
|
|
|
I think MFC sample CTRLBARS can help you. Toolbars are not unloaded or destroyed in it, they are just hidden. From user point of view this is the same.
|
|
|
|
|
Hello,
I think You can use RecalcLayout() function to solve this problem.
Peter
|
|
|
|
|
For control bars that belong to a particular CFrameWnd, you need to use the ShowControlBar() function rather than just calling CMyControlBar::ShowWindow(SW_HIDE). For example:
CMyDialogBar m_barHelper;
void CMyFrame::OnMDIActivate(BOOL bActivate, ...)
{
if (bActivate)
ShowControlBar(&m_barHelper, TRUE, FALSE);
else
ShowControlBar(&m_barHelper, FALSE, FALSE);
}
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hi everyone,
A quick question-- Does anyone know if it is possible to have big and small tic marks on a CSliderCtrl? I have a slider that has the range -100 to 100, and I would like to have small tic marks every 10, while having a big tic mark at 0, which marks the middle of the slider.
I am using
m_PCWF_slider.SetTicFreq(10);<br />
m_PCWF_slider.SetPageSize(5);<br />
Thanks for the help!
|
|
|
|
|
Check this:
http://www.codeproject.com/miscctrl/transparentslider.asp
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|