|
This may help. Sorry always forget how to do the clickety.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tapi/tapi3/telephony_application_programming_interfaces.asp
|
|
|
|
|
This is better. Now you have me interested in doing this.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k2/html/simpletapi.asp
or
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dntapi/html/msdn_ctapic.asp
|
|
|
|
|
I wrote my own programable syntax coloring text editor a while back and wish to make the editor (and document) portion into a comercial product (a.k.a. DLL, ActiveX).
The question are:
1) Should I convert it to non-MFC dependent code. (not MFCxx.dll dependency)
2) If converted should I make it use UNICODE internaly, regardless of OS, or continue the need to create UNICODE and non-UINCODE version.
Any ideas would be appriciated.
Why did I write it?
1) I needed a programable text editor for future projects that provided functionality not available any where else.
2) I wrote it because I could! It is the best way I know how to learn.
INTP
|
|
|
|
|
It depends what you are looking for. If you want a quick time to market, but high overhead cost (computer usage) then go with MFC. However, you can also choose ATL which is much leaner and write your control in that, since it is a templated library it will only compile and link the necessary code, unlike MFC which give you everything. Also if you want a smaller files size ATL would be nice, and when I say ATL you can program it in straight "C" for all that matters I just find ATL faster to write components (none of my components are commercial, all of them are for in house use only, you may wish to wait for the opinion of someone who has written a commercial project)
Also grats on writing it. To tell you honestly one of the contractors I work with just bought a text tool like this himself, I think there is a viable market for it.
Code4Food
----
"There is no try; only do or do not"
-Yoda
|
|
|
|
|
John R. Shaw wrote:
2) If converted should I make it use UNICODE internaly, regardless of OS, or continue the need to create UNICODE and non-UINCODE version.
If you use Unicode internally, you'll get heaps of problems trying to run in on Win9x. You could attempt it, but I'd probably run with two different builds. if you use TCHAR and the preprocessor, you should be able to use (almost) the same code for both builds.
John R. Shaw wrote:
1) Should I convert it to non-MFC dependent code. (not MFCxx.dll dependency)
Thats up to you, really. If it's non-MFC dependent, then both MFC and non-MFC programmers can use it. But, MFC programmers may not like it because it doesn't fit in with the Doc-View model without extra work by them - it's not a drop-in solution.
My suggestion would be to drop the MFC dependency, but create a simple MFC wrapper that makes it look like a CView - allowing everyone to use it without problems.
Ummm, just in case you're wondering, yes, I am feeling very backwards and upside-down today - shouldna drank so much last night...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
I am writing a small utitlity to run as a system tray application. I would like to be notified when a USB device of the type USB Mass Storage or Digital Camera is connected to the computer. Once my application receives this event, it will prompt the user if they want to copy the files from the device to the hard drive. Is there any sample code on how I can achieve this with my application? Many thanks in advance.
Tuan
|
|
|
|
|
Hi all, does the registry api functions refer to window messages behind the scences????
i.e - combo box function : AddString, eventually calls to CB_ADDSTRING message....
i am looking for the same for all the registry api functions such as:
RegOpenKeyEx,
WritePrivateProfileString
etc....
thanks
Yaron
|
|
|
|
|
I do not understand your question? "Do the registry APIs refer to Windows messages" makes no sense. Please explain in more detail.
|
|
|
|
|
i was just wondering how does the application regmon works (it monitors all the registery read/writes.....
can u help in explaination?
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote:
can u help in explaination?
Not as good as the authors themselves.
http://www.sysinternals.com/ntw2k/source/regmon.shtml
|
|
|
|
|
Your question is trying to compare apples and screwdrivers...
There is no Win32 SDK (*) function AddString. You are right in that you need
to use SendMessage (hWndCombo, CB_ADDSTRING, ...);. The AddString you are
thinking of is a member function of the CComboBox class in MFC which wraps the
underlying SDK for you.
RegOpenKeyEx etc are actual SDK functions in their own right.
Clear?
Iain.
(*) Which I assume you mean by API...
|
|
|
|
|
I agree with what you are saying.
i was just wondering how does the application regmon works (it monitors all the registery read/writes.....
can u help in explaination?
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
A few seconds reading of the sysinternals[^] website gives the following explanation of how regmon works:
How Regmon Works
The heart of Regmon on Windows 9x is in the virtual device driver, Regvxd.vxd. It is dynamically loaded,
and in its initialization it uses VxD service hooking (see our May 1996 Dr. Dobb's Journal article on VxD
= service hooking for more information) to insert itself onto the call chain of 16 registry access functions
in the Windows 95 kernel (Virtual Machine Manager). All registry activity, be it from 16-bit programs, Win32
applications, or device drivers, are directed at these routines, so Regmon catches all registry activity
taking place on a machine.
On Windows NT, 2000 and XP the Regmon loads a device driver that uses a technique we pioneered for NT called
system-call hooking. When a user-mode component makes a privileged system call, control is transfered to a
software interrupt handler in NTOSKRNL.EXE (the core of the Windows NT operating system). This handler takes
a system call number, which is passed in a machine register, and indexes into a system service table to find
the address of the NT function that will handle the request. By replacing entries in this table with pointers
to hooking functions, it is possible to intercept and replace, augment, or monitor NT system services.
Regmon, which obviously hooks just the Registry-related services, is merely one example of this capability in
action.
On Windows .NET Server Regmon takes advantage of a new operating system Registry callback mechanism to
register for and receive information about Registry accesses as they occur. When you run Regmon on .NET
Server it loads a version of the Regmon driver utlizing the callbacks.
When Regmon sees an open, create or close call, it updates an internal hash table that serves as the mapping
between key handles and registry path names. Whenever it sees calls that are handle based, it looks up the
handle in the hash table to obtain the full name for display. If a handle-based access references a key
opened before Regmon started, Regmon will fail to find the mapping in it hash table and will simply present
the key's value instead.
Information on accesses is dumped into an ASCII buffer that is periodically copied up to the GUI for it to
print in its listbox.
In short, it cheats, and grabs the information at a very low level. Not for the faint hearted...
Iain.
|
|
|
|
|
thanks
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Visual C++ Dialog Application
I have 6 radio buttons which I need to group as 3 pairs . How do I specify the the pairing ? i.e which radio is with which group . I am finding that actions in pair 3 affect radios in pair 1 ? Please help
|
|
|
|
|
The fisrt button in a group of radio buttons should be marked as group, under the genral settings in the properties dialog. The next item (in tab order) following the last radio button in a group should be marked as group, this signifies the end of one group and the start of the next.
INTP
|
|
|
|
|
thanks but somehow I couldnt get it to work .
Here is the sequence in Tab order
I need 3 pairs of radio buttons
GROUP1
Radio1(group)
Radio2( ungroup)
GROUP2
Radio3(group)
Radio4(ungroup)
GROUP3
Radio5(Group)
Radio6(ungroup)
Still i find that statuses for GROUP1 and GROUP3 are interfering .
still statuses for
|
|
|
|
|
I do not know what else to tell you except what I did to verify my previous answer.
1) I created a new dialogbox.
2) I added 6 radio buttons (nothing else)
3) I checked group on the fallowing items:
radio 1, radio 3, radio 5, and the OK button.
4) I checked tabstop on the fallowing items:
radio 1, radio 3, radio 5.
Now every thing works as it should.
The normal procedure I use for a group of radio buttons goes as follows:
1) Create a group box and check group (not tabstop).
2) Create a group of radio buttons in box and check tabstop on first button.
3) Make sure the tab order of the group box is 1 less than the first button.
INTP
|
|
|
|
|
Hi all,
I experienced a strange behaviour, maybe one of you knows something
about it.
I have a little application that call SHBrowseForFolder, after that it
connects to an SQL server via SQLDriverConnect. After some work it
releases every allocated ODBC handle.
Any subsequent call to SHBrowseForFolder will display an empty dialog,
not even the controls are drawn.
This happens only if there is a manifest file for this application to
use the new common controls.
I included the source code as a sample a little bit more down,
if you would like the complete Devstudio workspace, just email me.
I would be happy if any of you knows something about this,
thanks in advance,
Jens
Source code:
-----------------
#ifndef BIF_NEWDIALOGSTYLE
#define BIF_NEWDIALOGSTYLE 0x0040
#define BIF_USENEWUI (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
#endif
void Go()
{
// *** Doesn't help...
// ::CoInitialize( 0 );
BROWSEINFO bi;
ZeroMemory( &bi, sizeof( bi ) );
bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS;
SHBrowseForFolder( &bi );
SQLHENV env = NULL;
SQLRETURN sqlRet = SQLAllocEnv( &env );
SQLHDBC conn = NULL;
sqlRet = SQLAllocConnect( env, &conn );
SQLCHAR szOut[ 2048 ] = {0};
SQLCHAR sqlConn[ 1024 ] = "DRIVER={SQL Server};SERVER=(local)";
// SQLCHAR sqlConn[ 1024 ] = "DRIVER={Microsoft Text Driver (*.txt;
*.csv)};DBQ=test\\";
SWORD len = 0;
sqlRet = SQLDriverConnect( conn,
NULL,
sqlConn,
SQL_NTS,
szOut,
sizeof( szOut ),
&len,
SQL_DRIVER_COMPLETE_REQUIRED );
if ( ( SQL_SUCCESS != sqlRet )
&& ( SQL_SUCCESS_WITH_INFO != sqlRet ) )
{
SWORD nMessageLen = 0;
UCHAR szMessage[ SQL_MAX_MESSAGE_LENGTH ] = {0};
SDWORD dwNativeErrorCode = 0;
UCHAR szErrorState[ SQL_SQLSTATE_SIZE + 1 ] = {0};
sqlRet = SQLError( env,
conn,
SQL_NULL_HSTMT,
szErrorState,
&dwNativeErrorCode,
szMessage,
SQL_MAX_MESSAGE_LENGTH - 1,
&nMessageLen );
::MessageBox( NULL,
(CHAR*)szMessage,
(CHAR*)szErrorState,
MB_OK );
}
sqlRet = SQLDisconnect( conn );
sqlRet = SQLFreeHandle( SQL_HANDLE_DBC, conn );
sqlRet = SQLFreeHandle( SQL_HANDLE_ENV, env );
// *** Doesn't help...
// ::CoInitialize( 0 );
ZeroMemory( &bi, sizeof( bi ) );
bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS;
SHBrowseForFolder( &bi );
}
|
|
|
|
|
After the first call to SHBrowseForFolder(), the 'bi' variable is not used again until the end of Go(). Is this intentional? What happens if you remove everything SQL/ODBC related? Does SHBrowseForFolder() work repeatedly then?
|
|
|
|
|
bi is used again in the second call to SHBrowseForFolder.
You could use another instance, that doesn't matter.
SHBrowseForFolder works repeatedly is I remove the call to
"sqlRet = SQLFreeHandle( SQL_HANDLE_ENV, env );"
This happens only with the MS SQL Server ODBC driver.
If another driver is used (MS Text driver, Sybase Anywhere)
it works fine.
Thanks,
Jens
|
|
|
|
|
Jens Doose wrote:
bi is used again in the second call to SHBrowseForFolder.
Right, but's it's still not being used. The code pieces are disparate. The usage of 'bi' and the success/failure of the calls to SHBrowseForFolder() have nothing to do with the SQL-related stuff.
It's considered good practice to check the return values from all function calls. Something like:
void Go( void )
{
BROWSEINFO bi = {0};
SQLRETURN sqlRet
SQLHENV env = NULL;
SQLHDBC conn = NULL;
SWORD len = 0,
nMessageLen = 0;
SQLCHAR szOut[2048] = {0},
sqlConn[1024] = "DRIVER={SQL Server};SERVER=(local)";
UCHAR szMessage[ SQL_MAX_MESSAGE_LENGTH ] = {0},
szErrorState[ SQL_SQLSTATE_SIZE + 1 ] = {0};
SDWORD dwNativeErrorCode = 0;
bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS;
SHBrowseForFolder( &bi );
sqlRet = SQLAllocEnv(&env);
if (SQL_SUCCESS == sqlRet)
{
sqlRet = SQLAllocConnect(env, &conn);
if (SQL_SUCCESS == sqlRet)
{
sqlRet = SQLDriverConnect(conn, NULL, sqlConn, SQL_NTS, szOut, sizeof(szOut), &len, SQL_DRIVER_COMPLETE_REQUIRED);
if (SQL_SUCCESS != sqlRet && SQL_SUCCESS_WITH_INFO != sqlRet)
{
sqlRet = SQLError(env, conn, SQL_NULL_HSTMT, szErrorState, &dwNativeErrorCode, szMessage, SQL_MAX_MESSAGE_LENGTH - 1, &nMessageLen);
::MessageBox(NULL, (CHAR *) szMessage, (CHAR *) szErrorState, MB_OK);
}
sqlRet = SQLDisconnect(conn);
sqlRet = SQLFreeHandle(SQL_HANDLE_DBC, conn);
}
sqlRet = SQLFreeHandle( SQL_HANDLE_ENV, env );
}
ZeroMemory(&bi, sizeof(bi));
bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS;
SHBrowseForFolder(&bi);
}
Jens Doose wrote:
This happens only with the MS SQL Server ODBC driver.
If another driver is used (MS Text driver, Sybase Anywhere)
it works fine.
Or it's just being masked such that it appears fine.
|
|
|
|
|
Hi David,
that is true.
But that was not my point, maybe I didn't make myself clear enough.
The problem is that with Windows XP the second call to SHBrowseForFolder
does not work, either it isn't shown at all (when there is no manifest file)
or the dialog is shown, but it doesn't contain the control, which displays
all the folders (when having a manifest file).
And this problem only occurs when making a SQLDriverConnect to an MS SQL
ODBC driver in between this two calls. Any other driver is fine.
I discovered the problem in a much more complex environment, and believe
me, it did cost me some hours of my life to hunt the problem down to this
constellation .
To clarify the problem I wrote a simple test app that just calls SHBrowseForFolder
and SQLDriverConnect . That is why there is no error checking or why I don't use
the result value within bi .
Thanks
Jens
|
|
|
|
|
Jens Doose wrote:
The problem is that with Windows XP
Have you tried this on another platform to see if it is OS related?
Jens Doose wrote:
That is why there is no error checking or why I don't use
the result value within bi.
That's fine, and is common practice. I just wanted to emphasize that omitting error checking might have been the crux of the problem.
If you commented out both calls to SHBrowseForFolder() , thus leaving only the SQL-related code, can Go() be called repeatedly?
Perhaps after you are done with SHBrowseForFolder() , you should call IMalloc::Free() .
HRESULT hr;
LPMALLOC pMalloc;
LPITEMIDLIST pidlSelected = NULL;
hr = SHGetMalloc(&pMalloc);
pidlSelected = SHBrowseForFolder(&bi);
...
pMalloc->Free(pidlSelected);
|
|
|
|
|
hi,
i have currently written the code for a right click popup menu for a listctrl on a dialog box in the 'OnRightButtonDown' event.
But i want it to handled by the 'OnContextMenu' event.
How can i catch the WM_CONTEXTMENU message ?
Hari Krishnan
|
|
|
|
|