|
Try this:
CComPtr<IADsNameTranslate> pNto;
HRESULT hr=S_OK;
USES_CONVERSION;
WKSTA_INFO_100* pWkStaInfo=NULL;
CString strDomainName;
if (NetWkstaGetInfo(NULL, 100, (LPBYTE*)&pWkStaInfo)==NERR_Success) {
strDomainName=(OLE2CT((WCHAR*)pWkStaInfo->wki100_langroup));
NetApiBufferFree(pWkStaInfo);
}
Cheerz,
Aamir
|
|
|
|
|
Riily wrote:
need to any method to get the domain nam
if you looking for local domain you can depend upon GetNetworkParams api!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi,
i got the following problem. i'm writing an mfc mdi (derived from CScrollView) proram for displaying the samples of a wav file. everythnig works fine so far, but every time i scroll in my window the whole content (which is quite much)is repainted. i heard that this could be avoided by only painting the content once, creating a bitmap from it and in the future just use this bitmap whenever a repaint is done, but i simply can't get this working. any advise for me?
thx
christian
|
|
|
|
|
You should use some boolean flags for the objects not to be drown all the time and set their values according to your needs.
Coming now to your bitmap approach, you could transform the DDB (device-dependent-bitmap) to a DIB (device-dependent bitmap ) by using the GetDIBits() function twice (once to get the image size and again to get the bits), then with the DIB handle you can use StretchDIBits() whenever you need to do something with your image.
SkyWalker
-- modified at 6:33 Thursday 8th September, 2005
|
|
|
|
|
CScrollView handles most of the problems, you should be able to keep it simple.
1) Add a CBitmap member to your view class.
2) Disable OnEraseBkgnd() (just return TRUE).
3) Create a screen compatible memory CDC.
4) Create your CDC compatible bitmap (size is upto you).
5) Select bitmap into CDC.
6) Draw on CDC.
7) Restore origanal bitmap to CDC.
8) Release CDC
9)
OnDraw(CDC* pDC)
{
....
pDC->BitBlt(0,0,nWidth,nHeight,dcTemp,0,0,SRCCOPY);
pDC->ExcludeClipRect(0,0,nWidth,nHeight);
CRect rcClip;
pDC->GetClipBox(&rcClip);
pDC->FillSolidRect(
rcClip.left,rcClip.top,
rcClip.Width(),rcClip.Height(),
::GetSysColor(COLOR_WINDOW));
....
}
Well that should work.
You would normaly update the bitmap (create) in the OnInitialUpdate() or OnUpdate() functions as well as update the scrollbar limits. You'll want to write a seperate function UpdateScrollSizes() to update scrollbar limits, if you plan on adding a zoom feature.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
thx for the fast answers, works better now but something is still wrong. i used your solution john, here is my code :
BOOL CGALWaveView::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
void CGALWaveView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
CRect rect;
this->GetClientRect(&rect);
CDC pDC;
pDC.CreateCompatibleDC(&pDC);
//m_background is the image this->m_background.CreateCompatibleBitmap(&pDC,rect.Width()*GetDocument()->m_zoomFactor,rect.Height()*GetDocument()->m_zoomFactor);
pDC.SelectObject(&m_background);
OnDraw(&pDC);
sizeTotal.cx = rect.Width()*(long)GetDocument()->m_zoomFactor;
sizeTotal.cy = rect.Height();
SetScrollSizes(MM_TEXT, sizeTotal);
}
void CGALWaveView::OnDraw(CDC* pDC) {
CRect rect;
this->GetClientRect(&rect);
int zoom = GetDocument()->m_zoomFactor;
if (m_isDrawn==FALSE || m_zoomChanged==TRUE) {
...some drawing...
m_isDrawn=TRUE;
m_zoomChanged=FALSE;
}
else {
CDC* temp=NULL;
pDC->BitBlt(0,0,rect.Width()*zoom,rect.Height()*zoom,temp,0,0,SRCCOPY);
pDC->ExcludeClipRect(0,0,rect.Width()*zoom,rect.Height()*zoom);
}
now i got the problem that only the visible part is drawn, and whenever i scroll left or rigth, there is only white background.
any ideas?
thx
christian
|
|
|
|
|
Can give a simple example about the Dialog for both server and client.
Which is a Dialog for server and a Dialog for client. Really need help
|
|
|
|
|
|
Your request is a bit unclear. A dialog box is a UI component that allows interaction with a user. It matters not whether it runs on a client machine or a server machine.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
What I mean is an interface that I can type my message and send it using TCP protocol and another interface to receive the message I type.
|
|
|
|
|
hello,
Can somebody help me o how to set bitmap images on push buttons.Which function of CButton class will i have to use?and then i have to change the images a runtime.
thanks in advance
|
|
|
|
|
Please, try to use CBitmapButton. Check more information in MSDN. Another way is to use owner-draw button. There are alot in CodeProject site.
|
|
|
|
|
sayup wrote:
Can somebody help me o how to set bitmap images on push buttons
this link will help :-
http://www.codeproject.com/buttonctrl/[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
use CBitmapButton class...
actually when u drop a button on the dialog, it'll be set to CButton by default.
you go and change it to CBitmapButton.
After u put the Button on Dialog do this,
1.change CButton m_Button1 ---> to CBitmapButton m_Button1
2. on the button's property select "style" tab and check the "owner draw" .
2.include your bitmap file in the resource.
3. Note down the Bitmap's ID.
4.now in the oninit(), do this m_Button1.LoadBitmaps(IDB_BITMAP1);
you'll see nice colors on your dialog
Regards,
V
|
|
|
|
|
you should load differnt bitmaps inorder to see the "pressing" effect of the button. load two different images to test it.
ie
m_mButton1.LoadBitmaps(IDB_BITMAP1,IDB_BITMAP2,.,.,);
V
|
|
|
|
|
Hello mate,check this out: www.codeproject.com/buttonctrl/cimagebutton.asp
And your trouble days are gone...
Lefteris_RG3120
|
|
|
|
|
See here.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
i have included wintrust.h header file in stdafx.h
when i built my program it is showing me errors
c:\program files\microsoft visual studio\vc98\include\wintrust.h(139) : error C2143: syntax error : missing ';' before '*'
c:\program files\microsoft visual studio\vc98\include\wintrust.h(139) : error C2501: 'CMSG_SIGNER_INFO' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\wintrust.h(139) : error C2501: 'psSignerInfo' : missing storage-class or type specifiers
i check c:\program files\microsoft visual studio\vc98\include\wintrust.h ,wintrust.h header file is present
i m notunderstanding where is the problem.i think i do have to download any service pack
thanx in advance
|
|
|
|
|
You should check the order of included files.
|
|
|
|
|
i have change the order of my included files.i also included schannel.h
now my stdafx.h looks like
#include schannel.h
#include wincrpyt.h
#include wintrust.h
it is showing me error:cannot open the included file schannel
in my system i checked and found that schannel.dll is present but not the schannel.h
|
|
|
|
|
sunit5 wrote:
#include schannel.h
#include wincrpyt.h
#include wintrust.h
is it normal that we don't see the <> rounding the included files ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
is it normal that we don't see the <> rounding the included files ?
Actaully He want to show header file he including.....
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote:
toxcct wrote:
is it normal that we don't see the <> rounding the included files ?
Actaully He want to show header file he including.....
i think, he needs to check [] DO not treat <'s as HTML tags... right??
regards,
V
|
|
|
|
|
Vivekuniq wrote:
right??
Right,But it would be better, if you notify same to Sunit5
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Vivekuniq wrote:
i think, he needs to check [] DO not treat <'s as HTML tags... right??
No. The angle brackets are actually missing, instead of just not being displayed.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|