|
Does anyone have an example how to run JavaScript (or other ActiveScript as VBScript, etc.) from VC++? There is a lot of things that should be worked out to do this (the general problem is passing parameters). I need it ASAP and that's why I'm trying to find already working sample.
Any help will be appreciated.
Thanks!
|
|
|
|
|
Have a look to the MSSCRIPT.OCX ActiveX control. There're some sparse example in the MSDN Library.
I hope this control can help you.
-------------------------
Benoit Devigne
http://www.bdevigne.com
contact@bdevigne.com
|
|
|
|
|
I've been searching everywhere for a list of valid arguments to pass into a template class, and I can't find anything. I know that you can use "class" and any basic type, such as int, char, bool, etc., but I don't know how to pass in a string, for example.
I would like my template to be defined something like:
template<class t,="" string="" s=""> MyTemplate...
I've tried using "char *", "VARIANT", and "BSTR", but the compiler won't accept any of them.
Any help is greatly appreciated!
Thanks,
Jason
|
|
|
|
|
Hello,
I make my propertypages with the resource editor Visual Studio V6.
I create the propertysheet on the stack and I add the property pages.
The font from the property pages Arial 8 pt is however different than the one I have put with the resource editor Courier New 10 Pt. I tried the SetFont(&MyFont) function but my system make assertion failure.
My question is how can I change the font in my property sheets and -pages ? Any hel will be appreciated.
|
|
|
|
|
Is there a way for a syntactical equivalent for the (Java-) finally statement?
What is the most elegant way to simulate it without a subroutine?
Regards,
Juergen
|
|
|
|
|
Hi
there is
__finally
(2 underlines) but it is Microsoft specific - but as we are in the Visual C++ forum
Kurt
|
|
|
|
|
Hi
there is
__finally
(2 underlines) but it is Microsoft specific - but as we are in the Visual C++ forum
Kurt
|
|
|
|
|
Hi Kurt,
thanks for the reply.
But I want to be portable and can't use SEH.
I'm searching for some elegant solution without
subroutines.
What is the reason for no finally in standard C++?
Is there some better/exacter substitute than:
void finally() {
removecode;
}
try {
code;
} catch (Exception e) {
finally();
throw e; //if e shoudn't be chatched here
}
finally();
Juergen
|
|
|
|
|
Hello.
I'm making an ISAPI DLL - server extension.
I want to access an Access database (.mdb) throw ODBC in my code. When i call a DLL function from a browser code i want this function to make an ODBC calls.
When there is no any ODBC calls in the function code, the DLL works OK: returns HTML code and so on.
When i put only this 3 rows in the function code:
CMyRecordset rs;
rs.Open();
rs.Close();
and i browse (i call the function throw the browser) IIS gives me an error in installation or something...
I put my database .mdb file in a directori which is seen by IIS. ODBC is correctly set up and above code works when it is called from an ordinary application i tested it.
So i can not understand where is the problem. One told me that there is a special settings which must be made for an ODBC driver. I don't know yet...
Can anyone help me....
|
|
|
|
|
put try catch and see where is error.
Good luck,
Dror
|
|
|
|
|
What is the best way to read the sytemroot\system32, for different target pc's. example: winnt40\system32....winnt\system32...windows\system
This is in VC5.
Gerry.
|
|
|
|
|
take a look at the GetSystemDirectory() function
|
|
|
|
|
Thanks, this worked great...
Gerry.
|
|
|
|
|
hi,
I have written a MDI application that inherits CEditView for the view class. I wonder how can I load a text file without using the "Open File" dialogue box into the view. I have tried to insert the text line by line but it did not work because the application keeps printing at the same line in the view. It seems that there is a problem in generating new lines in the view. Any idea on how to solve the problem?
I appreciate your help.
Thanks.
leonwoo
|
|
|
|
|
CreateFile()
ReadFile()
CloseHandle()
make sure you put cr\lf at the end of each line not just lf
m_edit.SetWindowText(pData);
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
My band is a html document, when i change the html file in the band, using html links and then the close band (the x on the side, or the menu item )
i 'm getting the new page html (the link) that i pressed before closing the band. and i want to get the old document, ( my default document that is in the code.)
and the other problem .. and this is really somthing funny i have a text box (html text box) in the band and when i press the backspace button it doesn't delete the last letter .. in other words i can't delete the text box ... using the backspace or the delete button.
|
|
|
|
|
K. Your first problem I read as follows. You show the band with an initial page. click a few links and a different page is showing in the band. you close the band. Then show the band again and the page you see is the last page that you clicked to, not the initial page. This is because once you create a band object in IE it lives for the life of that IE instance. If you want it to always start at the initial page when the band is displayed then in the STDMETHODIMP <myband>::ShowDW(BOOL fShow) have your m_wnd object reset to the initial page using the res:// protocol.
Your second problem. This is due to the fact that the band is not implementing IInputObject. If it did you would then set focus to your HTML page and the backspace key should work. MSDN documents this http://msdn.microsoft.com/library/psdk/shellcc/shell/Bands.htm. Scroll to the bottom of the page and look for the heading "The IInputObject Interface" under "Optional Interface Implementations"
Cheers,
-Erik
|
|
|
|
|
I need help.
I need to change CDateTimeCtrl's background color (CEdit like part, not MonthCalendar).
Can any body helps me?
Eugene Karpov
|
|
|
|
|
I am about to write a dll that allows users to define keys (e. g. for a game), but I cannot distinguish between the right and left ctrl-key.
In the second parameter the WM_KEYDOWN-Message gives me this information in a DWORD-value (LPARAM), but I am not able to decode the information.
How can I get this done?
Thank you.
|
|
|
|
|
the right key (extended key) is pressed if bit 24 of lParam is set. so use the bitwise AND operator (&) to check that bit.
if (lParam & 0x01000000)
{
}
|
|
|
|
|
Thank you. Your tip works. But one question remains:
When I read "bit 24 of lParam", how do I get the binary code like "01000000" ?
|
|
|
|
|
0x01000000 is not a binary code, it is a hexadecimal number (note the '0x'). Each digit in a hexadecimal number represents four bits.
Hexadecimal Digital Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
So when we say bit 24 is set we get this
bit 33 2 2 1 1
number 1098 7654 3210 9876 5432 1098 7654 3210
| | | | | | |
binary 0000 0001 0000 0000 0000 0000 0000 0000
hex 0 1 0 0 0 0 0 0
Also look up bitwise operators in MSDN
|
|
|
|
|
I don't have any concern on this stuff,
but I want to say that you are very kind to do this!
Honestly I didn't ever tried to explain in detail in helping others
although I've got tons of information from others like you.
Sincerely I honor your work.
Regards,
Ryan
|
|
|
|
|
|
Ok, I've got an ATL appwizard with MFC support. Implemented a ActiveX server object (I'm trying to write an ASP extension to interface to some code i've already got working elsewhere).
To test the theories of ATL and COM, I'm trying to make a simple propert that returns the IP address of the client (from Request.ServerVariables("REMOTE_ADDR") ).
Here's the function I'm trying to use:
STDMETHODIMP CMyClass::get_GetIP(BSTR *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
IRequestDictionary *piRequestDic;
m_piRequest->get_ServerVariables(&piRequestDic);
VARIANT v_Param, v_Value;
_variant_t vt_Param;
vt_Param.Attach(v_Param);
vt_Param.Clear();
vt_Param.ChangeType(VT_BSTR,NULL);
vt_Param.SetString("REMOTE_ADDR");
piRequestDic->get_Item(v_Param,&v_Value);
VariantChangeType(&v_Value,&v_Value,0,VT_BSTR);
*pVal=v_Value.bstrVal;
return S_OK;
}
When I call a simple asp page that creates this object and attempts to read this GetIP property, IIS hangs. I have to use Winnt reskit's KILL.EXE to close it.
I have no idea whats wrong- i've followed my logic through several times and i'm oblivious to the prob.
help appreaciated thanks
jon h
|
|
|
|