|
VB Code:
Function GetArrayStr(ByRef retArray() As String) As Long
On Error Resume Next
ReDim retArray(32) As String
For i = 1 To UBound(retArray)
retArray(i) = "V" & CStr(i)
Next
GetArrayStr = 1
End Function
// set up our array size
SAFEARRAYBOUND rgsa[] ={32,0};//32 elements
SAFEARRAY* pTempArray = SafeArrayCreate(VT_BSTR, 1, rgsa);//1 dimension
//call our vb function
hr = IVBTestClass->GetArrayStr( &pTempArray, &ReturnValue);
BSTR bstrCurrent = NULL;
// get the number of elements in the array
long lElements=(pTempArray)->rgsabound[0].cElements;
// iterate through our array elements
for (long j = 1; j < lElements; j++)
{
// get our array element
hr = SafeArrayGetElement(pTempArray, &j, &bstrCurrent);
if(FAILED(hr))
break;
char *c = ConvertToAnsi(bstrCurrent);
cout << "The string is: " << c << "." << endl;
}
|
|
|
|
|
is there a list of windows messages in numeric order or a way to find out which message corrosponds with number 15?
|
|
|
|
|
ummmm
do you mean error messages or notification messages?
windows.h and the connected header files will define all message numbers so have a root around in there maybe
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
You can look up window messages in the VC debugger. Run your app in debug mode (F5), go to the Watch window, and enter "15,wm" in the Name column. The ",wm" means show the number as a window message. In this case, it'll show WM_PAINT.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
hehe
you see ... i knew there were people out there who know more than me ... thank god
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
hi guys
am writing an app that needs to browse through the windows address book (ala outlook express) but have gotten nowhere in finding the file format it uses ... i couldnt find any com objects that give a search facility either ... any clues ?
help appreciated
|
|
|
|
|
I have a CBitmap and I need to write it to a file on the harddrive. Does anyone have a function to do this?
|
|
|
|
|
Both codeproject and codeguru have example projects for doing this. If you want something more in depth ( jpeg/tif/tga/etc), go to www.paintlib.de
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Merry Christmas to all members from Simi, I m lkn for a script which can help me to retrieve directory information and root folder of a ip address or a url. i made in vb but it only searches my local drive of computer but not on the net. plz let me know if you have any part of the code and then i can try to develop more . i think i read it somwhere most of the developers have used c++ for this script but i not sure. i guess this is the code which most of the robot spiders are using. i came across asptear but they don't provde source for their .dll, it doesnt work properly. if you come across any articles pleez let me know.any direction will be appreciated as i m stuck and don't have any idea where to go.
Merry Christams
Simi Vij, Chicago
|
|
|
|
|
i think VC++ is very difficult or poor comarable with VBasic & Delphi
in improving the user interface , such as :
-change the back ground color of a dialog box ?
-put an image as background ?
-or change the colors of the main bar(caption bar)?
is it really difficult or there is some easy way to reach that?How?
|
|
|
|
|
Nothing is dificult about changing the user interface as long as
you know where to look in the MFC help
the background color of a dialog can be easily changed in
WM_CTLCOLOR
look for CWnd::OnCtlColor in the help.
MFC is not as easy as VB and Delphi but it gives you more control over
your application
|
|
|
|
|
In your CProjectApp.cpp do:
SetDialogBkColor(RGB(0,0,0));
This would change the dialog background to black
To use an image you can use BitBlt.. if you need help with it let me know
|
|
|
|
|
BUT is it possible to do the same using WTL (no MFC) .. how ??
|
|
|
|
|
Any one know how to get rid of the Hor Scroll bar and Vertical Scroll bar in a Single Document??? You know how when it automatically put the scroll bar for you???But in this case I don't want any of it so anyone know how can I get rid of it??? Please help
|
|
|
|
|
Look in your view class's header file and see if you are deriving from CScrollView.
If so, change to derive from CView instead.
You may have to clean up some functions that no longer apply -- the compiler will let you know.
|
|
|
|
|
How can I can the dialog size manually??? After I opened the dialog, and I want to change the width and length of the dialog?? HOw?
|
|
|
|
|
SetWindowPos or MoveWindow
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I've looked around for some example code for how to add a button ( or any other control) to a custom control
which is based on a CWnd. All the examples are for adding buttons and stuff to dialogs. which is simple and easy
and I'm sure this is to - i just want to get it done the right way.
CButton m_Button;
m_Button.Create( ...?
...?
what is needed? (not useing a dialog)
thanks
|
|
|
|
|
I'm not sure what it is you wish to achieve? A composite control that consists of a button and something else? Where you create that button will also depend on which you parent is going be. Pleas give a little more information.
Happy programming!!
|
|
|
|
|
I hate to say this, but I don't understand how the documentation could be any clearer on this.
m_Button.Create("OK", WS_VISIBLE|WS_CHILD, CRect(0,0,100,100), &m_the_control_i_want_as_parent, THE_ID_I_WANT_TO_USE_FOR_THIS_CONTROL);
About the only two things in there that might be confusing are the styles, (which need only specify that the control should be shown (WS_VISIBLE) and that it's a child control (WS_CHILD)) and the ID, which usually MSDev creates for you. You just pick and ID that's unique to this dialog and use it.
Now, this should work fine as long as the control you using as a parent doesn't blit over you with drawing code.
|
|
|
|
|
Anyone know where or how I can get hold of the AVI that gets played when say a help file is first open and the index is created. The one where a pen writes in a book.
Thanks
|
|
|
|
|
How can I obtain the local machine name thru code in vc5. What api can I use & where would I find a sample?
Thanks.
|
|
|
|
|
Use the Win32 API GetComputerName:
TCHAR pBuffer[61];
DWORD dwSize = 60;
GetComputerName( pBuffer,&dwSize);
|
|
|
|
|
Hi,
I have made a dialog based MFC application which I want to download using the <object> tag in IE as if it was an ActiveX control. This works just fine, but does anyone know how to read the
<param name="aaa" value="aaaa">
tags within the object tag?
<object id="myapp" codebase="myapp.exe#-1,-1,-1,-1">
<param name="aaa" value="aaa"> <-- I need to read this tag from my app.
please ?
regards,
Martijn.
|
|
|
|
|
Hi,
I have made a dialog based MFC application which I want to download using the <object> tag in IE as if it was an ActiveX control. This works just fine, but does anyone know how to read the
<param name="aaa" value="aaaa">
tags within the object tag?
<object id="myapp" codebase="myapp.exe#-1,-1,-1,-1">
<param name="aaa" value="aaa"> <-- I need to read this tag from my app.
please ?
regards,
Martijn.
|
|
|
|