|
Quoting Chris Maunder:
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
George
-- modified at 14:50 Saturday 27th October, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
hi all
I need to change picture in my dialog, when user push some button.
it is firts time when I use Picture control im my dialog.
help me if you can.
|
|
|
|
|
Are you using MFC or straight Win32 APIs?
The basic steps are:
1) respond to button press
2) load a new bitmap for the picture control
3) set the picture control's bitmap to the new bitmap
Which part are you having trouble with?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have problem with step #3 I cant replase bitmap .
|
|
|
|
|
thanks
I Find in MSDN class CStatic and I solve my problem using this class.
|
|
|
|
|
If you want to set picture to a control like Static you can use of SetBitmap that it gets a hbitmap for parameter and also use of LoadImage or CImage class for load image.
|
|
|
|
|
Hi,
I have a DLL write in VC , in this DLL a function is declare follow :
BOOL InitMyDLL(LPWORD Alpha, LPWORD wrdpack);
now i want use this function in my VB project , but any type get for LPWORD (Inteeger , long , double ,...) and run my project when this function call get this error :
run-time error '49':
bad DLL calling convertion.
I Declaration this function in VB follow :
private declare Function InitMyDLL lib "MYDLL" (ByRef Alpha, Packet() as long) as Boolean
second parameter is a array !!!
please help me,
thanks for all.
|
|
|
|
|
i am new to vc++ programming and i want to make an invisible text box visible during runt time. i made the variable name with type CString for that text box. Can anybody help me in solving this problem.
|
|
|
|
|
you said you made the variable with type CString. thats fine.
you also create one variable for that same text box as type CEdit from class wizard.
now, whereever you want to hide it,
call as follows.
variable.ShowWindow(FALSE);
or you can do like this also, but iam not sure
GetWindow(IDC_EDIT1)->ShowWindow(FALSE);
obviously, make it TRUE to Show it.
Good luck.
-- modified at 3:59 Saturday 27th October, 2007
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
|
I think this can be done by right clicking the Edit box----properties--->select the "Visible"(checked).(in the Resourse View)
Or
u can do it using the same command as chandu told..
i.e., GetDlgItem(IDC_EDIT)->ShowWindow(TRUE)
I thnk this command brings you the solution.
Thanks,,
saravana...
|
|
|
|
|
Chandu's answer is right. But don't use the code in the OnDraw () or OnPaint () messages, you will start a loop or update the window. Put it in a button, mouse click or something like that
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
in my vc project: i write assembly codes (with __asm keyword). i compile my project in windows 32 bit, it has any error. BUT in Windows 64 bit, it doesn't know __asm keyword and other assembly instruction. what do i do?
Zo.Naderi-Iran
|
|
|
|
|
|
Hi,
In a dll's ininstance , I am loading a dll with LoadLibrary & Setting the returned handle
as Application's resource handle, with AfxSetResourceHandle(Server side). Later, when a client request to the server, I check the resource handle of the application with AfxGetResourceHandle, it is 0. Can anyone tell why?
Vinod.C.S
|
|
|
|
|
Have you tried with AFX_MANAGE_STATE ?
Please refer here[^] for more information.
Regards,
Paresh.
|
|
|
|
|
So let's say that I have something like:
class A
{
public: virtual void foo() {...}
};
class B : public A
{
public: virtual void foo() { A::foo(); ... }
};
In the overwritten method foo , I used the sentence A::foo in order to call the parent's version of this method. Now, let's say that rather than overwritting a method, I want to overwrite an operator overload. How would I call the parent's version? I mean:
class A
{
public: A& operator= (const A& a) { ... }
};
class B : public A
{
public: B& operator= (const B& b) {
...
}
};
Is it even possible?
Thanks in advance.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Do you get any errors using that code?
-- modified at 6:15 Saturday 27th October, 2007
// "In the end it's a little boy expressing himself." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Actually I haven't tried it, I just made it up in order to express my doubt. Now that you've mentioned it, I'm gonna try. Still, would this be standard compliant?
Thanks for your reply.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Fernando A. Gomez F. wrote: would this be standard compliant?
As much as I know, there's nothing wrong with that code.
// "In the end it's a little boy expressing himself." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
It compiles at least. Whether it works, it remains to be seen yet. And if it's not standard compliant, I'll eventually know when a code auditory takes place .
Thanks a lot!
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Fernando A. Gomez F. wrote: if it's not standard compliant, I'll eventually know when a code auditory takes place
:-DSure it is. I've seen this several times in several codes already.
Fernando A. Gomez F. wrote: Thanks a lot!
Your welcome.
// "In the end it's a little boy expressing himself." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
VBScript code:
set oWMI = GetObject("winmgmts:/root/cimv2")<br />
<br />
Set colItems = oWMI.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _<br />
wbemFlagReturnImmediately + wbemFlagForwardOnly)<br />
<br />
For Each objItem In colItems<br />
strDomain = objItem.Domain<br />
strRole = TranslateDomainRole(objItem.DomainRole)<br />
Next<br />
<br />
<br />
<br />
function TranslateDomainRole(byVal roleID)<br />
Dim a<br />
<br />
Select Case roleID<br />
Case 0<br />
a = "Standalone Workstation"<br />
Case 1<br />
a = "Member Workstation"<br />
Case 2<br />
a = "Standalone Server"<br />
Case 3<br />
a = "Member Server"<br />
Case 4<br />
a = "Backup Domain Controller"<br />
Case 5<br />
a = "Primary Domain Controller"<br />
End Select<br />
TranslateDomainRole = a<br />
end function
-----------------------------------------------------
What's Domain Role? how to get it in C++(not use WMI)?
Thanks.
|
|
|
|
|
HOW WHAT wrote: how to get it in C++(not use WMI)?
Use NetServerGetInfo() .
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi everyone,
this is a certainly well discussed problem, but I can't make head or tail of it.
I am using a CWinThread, and I am using a CAsyncSocket somewhere within it. But OnReceive is never triggered! On the other hand, when calling AfxMessageBox only once from within the thread, the message pump is working... all events are triggered from now on, everything works fine.
So why can the message pump be started through AfxMessageBox? Does the socket get a handler to some socket window through some magic? And why can't I simply start the pump by calling some Afx message that is not visible!? I tried creating the asynchronous socket at the thread's InitInstance, no difference. I attached there some socket that was created within the main dialog - again no difference. What do I do wrong? What should I do??
I am confused, any help appreciated.
Thanks in advance,
Roland
|
|
|
|