|
aavesh wrote: how to paste the code on forum.
Please post only relevant code snippets. No one likes to wade through pages of code.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I have taken formview,i have built tabcontrol on form,i have handled ON_WM_CONTEXTMENU() in form view class..Now when right click on tabcontrol the context menu appearing, i don`t want it to appearing when i right click on tabcontrol,i want it to appearing only other remaining area of the form view...How to do this , is there any way...
Thanks in before
James
|
|
|
|
|
You can use from pWnd in contextmenu like this
if (pWnd->m_hWnd!=m_Tab.m_hWnd)
....
whitesky
|
|
|
|
|
You could check the pWnd parameter of OnContextMenu handler and not display your context menu if it's the tab control window.
i.e.
if (pWnd != pTabCtrlWnd)<br />
{<br />
}<br />
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Thank q every much.its working..
James
|
|
|
|
|
How can I change the fonts of edit box.
Thanks to all.
|
|
|
|
|
Create a member variable( of control type ) for the edit control and call the SetFont funtion of that variable.
nave
|
|
|
|
|
<br />
CFont m_Font;<br />
m_Font.CreateFont(...);<br />
m_EditBox.SetFont(&m_Font);<br />
whitesky
|
|
|
|
|
But It is Giving Debug Assertion Failed..
-----------------------------------
CFont font;
font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial"); // lpszFacename
m_Edit.SetFont(&font);// where m_Edit is: CEdit m_edit;
----------------------------------
|
|
|
|
|
|
It is Giving Debug Assertion Failed..
NO Error. Assertion Failed.... for the line m_Edit.SetFont(...
Where have to give this code " m_Edit.SetFont(... "
|
|
|
|
|
I dont know your error use from debugger but i write and i check this code not problem and it work
please see,
<br />
CEdit m_Edit2;<br />
CFont font;<br />
<pre>
m_Edit2.Create(WS_CHILD|WS_VISIBLE,CRect(100,0,250,23),this,1);
font.CreateFont(
12,
0,
0,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS,
_T("Arial"));
m_Edit2.SetFont(&font);
</pre><br />
test this code and answer to me it has error or it work <br />
<br />
<font size="2" color="#99ff66"><hr></font><div style="padding: 2px; text-align: left; color: rgba(255, 255, 255, 1); width: 80px"><font size="2" color="#99ff66">whitesky<br />
</font></div><hr>
|
|
|
|
|
Yes the code is working;
Thanks a lot.
|
|
|
|
|
|
how to change the background color of menu bar ?
THX
|
|
|
|
|
|
Or easier, without the need to ownerdraw:
MENUINFO mi;
memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.hbrBack = hBrush;
mi.fMask = MIM_BACKGROUND;
SetMenuInfo(hMenu, &mi);
|
|
|
|
|
<A
href="http://www.somesite.com/sth.asp" target=_blank>
<img height=100 src="see.jpg" width=600 border=0>
</A>
the html code above show a picture with a link.
How could I filter the img without change the link?
I tried Name Space,I can only show a white area with the link.
I tried Mime Filter,I can only replace some text with some other text.
What I want to do is to replace the IMG with a CString such as "killbill" with the original link. AND also,the HTML code shouldn't change.
How could I do so? thank you.
|
|
|
|
|
Hey, I am trying to send an integer from a VB 6.0 application to a VC++ 6.0 DLL. I know how to send strings, but still having trouble getting numbers to take.
I represent the incoming data as an u_int, I interpret the return as a long, and I send the data as an Integer.
VC++ 6.0 Side:
int _stdcall test(u_int test1, u_int test2, u_int test3)
{
return 0;
}
VB 6.0 Side:
Public Declare Function test Lib "MyDll.dll" (ByVal test1 As Long, _
ByVal test2 As Long, _
ByVal test3 As Long) as long
Call test(1,100,25)
The initial setup crashes the application. So, I just need help sending numeric values to my dll, so that i can interpret them as u_int and use their values in my code. So, if I send the number 100, I need that number to go to my dll and be defined as 100, so that I can use that number in my code, within the function.
need more info? let me know, all help is appreciated, thanks in advance
salut
|
|
|
|
|
I'm not a big fan of COM but this is one of those instances where you'll find setting up a COM interface in the dll greatly simplifies interactions with VB 6.0.
|
|
|
|
|
not a big fan either. It causes a GPF because I am sending the wrong variable type. What is the vb equivalent to u_int. I thought long. It shouldn't be that hard to send an numeric value from VB 6.0 to a VC++ DLL, I am sure there is an easier way, any one? thanks anyway and thanks to those to come in advance.
Salut
|
|
|
|
|
I don't believe there is one. VB has no concept of unsigned integers.
Anna
Currently working mostly on: Visual Lint
Anna's Place | Tears and Laughter
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
|
|
|
|
|
hmm, you would think long would work. I suppose I should define my vars on the C++ side, as something more VB compliant. I think I have this one solved, in a generic way. Perhaps, some suggestions? tia
salut
|
|
|
|
|
borono wrote: all help is appreciated
VB6 Doesn't know Unsigned integers, just use the long type (both VB & VC).
borono wrote: I need that number to go to my dll and be defined as 100
In that case what is wrong with just using a plain integer (this one I know works, I have used this method)?
Public Declare Function test Lib "MyDll.dll" (ByVal test1 As Integer,<br> _ ByVal test2 As Integer,<br> _ ByVal test3 As Integer) as Integer
int _stdcall test(int test1, int test2, int test3) {
If your returning 0, why return anything at all? Returning void will work, change your vb declare from a Function type to a Sub type.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi everyone,
Is it possible to access protected function of one class from another class? can anyone please give me a suggestion for this?
Thanks in advance.
Regards,
Ram
|
|
|
|
|