|
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
|
|
|
|
|
Hello all. I have the following lines in my .h file (I've included the 'map' header file, and declared 'using namespace std':
typedef LRESULT (CALLBACK *MsgHandlerProc)(HWND,WPARAM,LPARAM);
typedef map<uint, msghandlerproc=""> MessageMap;
typedef MessageMap::iterator MessageMapIterator;
In my implementation file, I have the following:
MSG_HANDLER_ERROR CMsgHandler::AddHandler(UINT uMsg, MsgHandlerProc lpProc)
{
MessageMapIterator it;
it=MsgMap.find(uMsg);
if (it==MsgMap.end())
return MSG_ALREADY_DEFINED;
try
{
MsgMap.insert(pair<uint, msghandlerproc="">(uMsg, lpProc));
return MSG_SUCCESS;
} catch (...) {
return MSG_ERROR;
}
}
Though I get no errors when compiling, I get 70 something warnings, all having to do with _Tree. What does this mean? What am I doing wrong? Thanks in advance for any help.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
what are the warnings?
if they're 4768, you can get rid of them with a simple:
#pragma warning(disable:4786)
put this before your STL includes (and after, too sometimes)
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Interesting. Every one of the warnings were C4768. Adding the #pragma before the 'map' inclusion resolved the warnings. Is this one of the supposed many problems with Microsofts implementation of STL?
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
i'm not sure if it's an MS problem or not (really, i don't know). but it's caused when identifier names grow too large due to template expansion (which STL collections apparently do a lot of).
i just always toss that pragma in whenever i use STL, just to keep things quiet.
there used to be a lot of info on this on Deja.com, but i don't see it anymore.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Thanks for the help, Chris!
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
MS's c++ compiler is still based on a very old version of the C++ compiler that predates both the STL and templates. MS has modified it to allow templates and do a lot, but some of the basic issues surround debug info are still based on the old MS "code view" debugger (which was actually licensed from NuMega).
One of those limitations is that the debug symbol name cannot be larger than 255 characters. Unfortunately, when STL templates expand, they often generate names that are larger than 255 characters. This causes the compiler to issue a warning that it is truncating the debug info to stay within the 255 character limit.
This doesn't effect C++ code built in release mode, and it doesn't effect the actual code in debug either, just the debug information, which can cause problems for the debugger (but usually not).
It's an informational warning, and can be safely turned off.
This isn't a "problem with STL", but it is annoying.
|
|
|
|
|
And just to make it a little more annoying, it's not always possible to turn it off!
http://support.microsoft.com/support/kb/articles/Q167/3/55.ASP
We have had several situations with complex header includes where no amount of "#pragma" will stop the warnings - but we have always been able to solve this by reorganising headers (changing the order of includes and sprinkling a generous helping of #pragmas, basically).
|
|
|
|
|
And just to make it a little more annoying, it's not always possible to turn it off!
http://support.microsoft.com/support/kb/articles/Q167/3/55.ASP
We have had several situations with complex header includes where no amount of "#pragma" will stop the warnings - but we have always been able to solve this by reorganising headers (changing the order of includes and sprinkling a generous helping of #pragmas, basically).
|
|
|
|