|
No, I don't want a Shell Namespace Extension, I want something similar. What I want to achieve is something (actually, my problem is more complex, but you can use this as a pretty good example) like the Zip folders on Windows XP, but I would like that every Windows application could access it, not only the shell.
I don't know if I'm being clear here, what I want to achieve is to "map" a zip file in a drive letter. The most similar thing to what I'm trying to do is the M:\ drive on the Exchange Server 2000.
So, what do I need to do? A device driver? A filter driver? Can you point me to some example?
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
you should probably use a disk simulator driver...
so the os creates it own file system on it and you can handle it like every other drive.
|
|
|
|
|
Try googling for Galen Hunt at Microsoft Research. He wrote something presented on a Usenix conference some years ago that would let you implement a filesystem in user- (i.e. x86 ring3)-mode.
If you get something working using this approach it would be nice to see an article here at CP about it.
|
|
|
|
|
Hi,
I have set up a shared data segment in a DLL which works fine in XP and 2000 but when I take it over to WinME then it does not work, I can set the value but other processes that load the DLL still have the value set to NULL.
Here is the segment
[code]
#pragma data_seg(".shared")
HANDLE hProcess = NULL;
HWND hWndService = NULL;
#pragma data_seg()
#pragma comment(linker,"/SECTION:.shared,RWS")
[/code]
Any Ideas?
Ceri
|
|
|
|
|
WWW-service crashes while starts ISAPI filter dll (VC++ 6) when trying to connect to Sybase database through ODBC.
I need to open ODBC connection on filter startup and keep it running to speed up base-related operations. So I call SQLConnect from DllMain and try to connect base (see example of code). It works perfect with Oracle database, but it doesn't work with Sybase (though compiled as Win32 Application it works with Sybase too).
Code
========================================================================
#include <windows.h>
#include <httpfilt.h>
#include <sql.h>
#include <sqlext.h>
#include <stdio.h>
#define ODBC_SUCCESS(rc)\
(((rc)==SQL_SUCCESS)||((rc)==SQL_SUCCESS_WITH_INFO))
HENV henv;
HDBC hdbc;
HSTMT hstmt;
BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, LPVOID lpReserved)
{
switch (ulReason)
{
case DLL_PROCESS_ATTACH:
SQLAllocEnv(&henv);
SQLAllocConnect(henv, &hdbc);
RETCODE rc;
// here www-service freezes
rc=SQLConnect(
hdbc,
(unsigned char *) "DSN",
SQL_NTS,
(unsigned char *) "LOGIN",
SQL_NTS,
(unsigned char *) "PASSWORD",
SQL_NTS
);
if (!ODBC_SUCCESS(rc)) { ... // connection error }
DisableThreadLibraryCalls(hInst);
break;
case DLL_PROCESS_DETACH:
SQLDisconnect(hdbc);
SQLFreeConnect(hdbc);
SQLFreeEnv(henv);
break;
default:
break;
}
return true;
}
BOOL WINAPI GetFilterVersion(HTTP_FILTER_VERSION * pVer){ ... }
DWORD WINAPI HttpFilterProc
(
HTTP_FILTER_CONTEXT* pFC,
DWORD NotificationType, VOID* pvData
){ ... }
========================================================================
If somebody know how to solve this problem - help needed.
|
|
|
|
|
You should do your init work in HttpFilterProc.
MSDN notes that it is dangerous to load any libraries in the
DllMain function and ....
Warning On attach, the body of your DLL entry-point function should perform only simple initialization tasks, such as setting up thread local storage (TLS), creating objects, and opening files. You must not call LoadLibrary in the entry-point function, because you may create dependency loops in the DLL load order. This can result in a DLL being used before the system has executed its initialization code. Similarly, you must not call the FreeLibrary function in the entry-point function on detach, because this can result in a DLL being used after the system has executed its termination code.
Calling functions other than TLS, object-creation, and file functions may result in problems that are difficult to diagnose. For example, calling User, Shell, COM, RPC, and Windows Sockets functions (or any functions that call these functions) can cause access violation errors, because their DLLs call LoadLibrary to load other system components. While it is acceptable to create synchronization objects in DllMain, you should not perform synchronization in DllMain (or a function called by DllMain) because all calls to DllMain are serialized. Waiting on synchronization objects in DllMain can cause a deadlock.
To provide more complex initialization, create an initialization routine for the DLL. You can require applications to call the initialization routine before calling any other routines in the DLL. Otherwise, you can have the initialization routine create a named mutex, and have each routine in the DLL call the initialization routine if the mutex does not exist.
Hope this helps
|
|
|
|
|
FYI, I have never been able to connect to Sybase via ODBC in either a filter or extension either. I think it has to do with different TCP/IP stacks used by CTLib. You might want to try Named Pipes?
|
|
|
|
|
I want to let my computer search SQL Server's computer name and SQL Server name in local network and list them, but i don't hnow how to do it.
|
|
|
|
|
See
INT dbserverenum (
USHORT searchmode,
LPSTR servnamebuf,
USHORT sizeservnamebuf,
LPUSHORT numentries );
in the SQL Server dblibrary.
|
|
|
|
|
I am using a C library which contains functions that use FILE* to send data to a file. Since I am writing my code in C++ and using ofstream, is there a way to gain access to the underlying FILE variable that is nested in ofstream to send to these functions?
Any help will be gladly accepted.
Justin Turney
|
|
|
|
|
I am not familiar with C and FILE *. However, ofstream does have a function that returns a pointer to the data buffer.
rdbuf()
Kuphryn
|
|
|
|
|
I do believe it is in stdio.h
|
|
|
|
|
Justin Turney wrote:
is there a way to gain access to the underlying FILE variable that is nested in ofstream
No, at least not in a portable way. You might cheat by hard-coding for a particular implementors specific version of the C++ library, but since that's a really ugly thing to do I obviously can do nothing but strongly recommend against it.
Now, what you can do is drop the f requirement and use ostream . Then you could instantiate a basic_ostream class that is implemented with a specialized streambuf that both uses and exposes the C stream interface (using FILE*).
Since this is almost a FAQ, I refer you to google and/or comp.lang.c++.moderated for further information.
|
|
|
|
|
dear all,
i want to develop an app (non gui based) which takes screen grabs and saves them to a bmp file.
i know how to get the screen grabs but i have no ideat about how to save it as a bmp file in a specified folder without using the file save dialog box.
is there any link for the same.
can it be done.
any ideas, clues, suggestions will be appreciated!
regards,
rIsHaBH
|
|
|
|
|
I would use the CFile class...
|
|
|
|
|
You need to roll your own bitmap save function (BITMAPCOREHEADER and BITMAPINFO) or search for "bitmap saving" at codeproject (27 hits)(multiple file formats).
Trust in the code Luke. Yea right!
|
|
|
|
|
look code:
IHTMLDocument2 *m_spActiveDoc2;
LPFNOBJECTFROMLRESULT pfnObjectFromLresult;
DWORD dwMsg;
LRESULT lRes;
HRESULT hr;
dwMsg = RegisterWindowMessage("WM_HTML_GETOBJECT");
SendMessageTimeout(hControl, dwMsg,0,0,SMTO_ABORTIFHUNG,1000,(DWORD*)&lRes);
pfnObjectFromLresult = (LPFNOBJECTFROMLRESULT)GetProcAddress(hInst,"ObjectFromLresult");
if(pfnObjectFromLresult != NULL)
{
hr = (*pfnObjectFromLresult)(lRes,IID_IHTMLDocument,0,(
void**)&m_spActiveDoc2);
if(SUCCEEDED(hr))
{
IHTMLElement *m_spActiveElement;
hr = m_spActiveDoc2->get_activeElement(&m_spActiveElement);
if(SUCCEEDED(hr))
{
BSTR TagNameBStr;
AnsiString TagName;
BSTR LocationURL = NULL;
m_spActiveElement->get_tagName(&TagNameBStr);
TagName = AnsiString(TagNameBStr).UpperCase();
if(TagName == "A")
//here I can't get "option" or "select" object,why?but others ,like A,INPUT,..., i can get it!
...
|
|
|
|
|
HI
I m now going to make project on speech to text
i want to do to make a soft ware that is able to write words on notepad when we speek
can any body now how to start how to get helf and from where to get help
plss tell me i will be very thanks ful to u
regard
HUssain
u can do any thing but need a key that is hard work
|
|
|
|
|
I'm not sure how to do it but I would look here[^] first.
|
|
|
|
|
This is a very complex area, that has seen considerable billion of dollars of both corporate and academic research, and still the best that has been produced (to my knowledge) is Dragon... (speak? talk? Something like that).
I think the best you could do is either this link or buying an existing solution.
|
|
|
|
|
look for sapi in the internet and download the latest sdk from microsoft...
there are samples from Microsoft in the sdk too...
it seems that sapi 5 is not well documented as sapi 4...
Hope this helps...
PS:
I've tried to handle those things, but as I don't wand to use english (and I have no time to test it) I have not been able to get it to work... (by now...)
|
|
|
|
|
Hi,
i'm implementing a splitted frame window with a CListView on the top part of the window and a CFormView on the bottom. When i click on an item of the list in the form i want to visualize the informations of that element (some kind of Master/Detail logic).
The problem is that when i focus in the form the selection in the CListView disappeared. If i re-focus the list the selection appears again. There's a solution to prevent this disappear?
Thanks
|
|
|
|
|
Use the LVS_SHOWSELALWAYS style.
|
|
|
|
|
Thanks, i didnt found it on MSDN ( ), thanks again
|
|
|
|
|
It's right there with the other list view styles:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/styles.asp
|
|
|
|