|
Third way:
Change the default value of
HKEY_CLASSES_ROOT\exefile\shell\open\command
to
"c:\\pathtoyourfile.exe" %*
Your app gets called for every dblclk on ANY exe.
Then ShellExecute the original app (from command line).
Peter Molnar
|
|
|
|
|
Does anyone know if BLOBs can be inserted into an Oracle database, via a VC++ client, by creating and executing a SQL insert statement. I seem to recall reading somewhere that BLOBs can only be inserted via calling a stored procedure in the Oracle dB.
|
|
|
|
|
We used ADO to connect to our Oracle database. ADO can get/set BLOB data by using a SAFEARRAY attached to a variant. I can provide more detail if desired.
--
Joel Lucsy
|
|
|
|
|
I would appreciate any detail you can provide. This is the first database task I've worked on. -Thanks!
|
|
|
|
|
First, we used the class found at http://www.codeproject.com/database/caaadoclass1.asp[^]
Then we did something like to add to the database:
<br />
CADODatabase db;<br />
CADORecordset rs;<br />
COleSafeArray sa;<br />
void *buf;<br />
_variant_t v;<br />
sa.CreateOneDim( VT_UI1, );<br />
sa.AccessData( &buf );<br />
<br />
sa.UnaccessData();<br />
v = sa.Detach();<br />
db.Open( "<some connection string>" );<br />
rs.Open( db.GetActiveConnection(), "select * from table", CADORecordset::openQuery );<br />
rs.Edit();<br />
rs.SetFieldValue( "blobfield", v );<br />
rs.Update();<br />
rs.Close();<br />
db.Close();<br />
The code to read is similar. Let me know if you need that also.
--
Joel Lucsy
|
|
|
|
|
Hi all,
I'm doing a C++ programming on mobile agents...and I've been trying to find a way to get the CPU and memory usage using C++, so exatly like what we can get from Windows Task Manager.
I've looked into GetSystemInfo() and GetProcessMemoryInfo(), but there's not much useful information that I can get from them...
Can sombody help me? Thank you very much
Clara~
|
|
|
|
|
You might want to look at CreateToolhelp32Snapshot , Process32First and Process32Next .
<EDIT>Ooops - my bad - was thinking of the Processes tab... </EDIT>
|
|
|
|
|
GetPerformanceInfo found in PSApi.h is useful for getting memory usage information. For the processor load information, I've got no clue.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
|
|
thx for all the suggestions....will go through them =)
Clara~
|
|
|
|
|
Now I create the dialog box and then I create one button control on dialog box.
Now my question is how I can click the button control after it will activate the windows Explorer.
|
|
|
|
|
I understood that you have a dialog box, with one button, and what you want to do is to fire up Windows Explorer when this button is clicked.
See ShellExecute method in the Platform SDK.
If this is not what you wanted, specify in more detail and/or write more clearly.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi,
Does anybody know how I can program in something like what Windows does when you double-click on a file? i.e. it automatically opens using the program you've specified for that file type. If it's a txt file it'll open with notepad or wordpad or whatever you use, a C++ file might open with editpad or VC++, a bitmap might open with MSpaint or whatnot.. etc, hopefully someone understands what I'm talking about.
Thanks
Kelly Ryan
|
|
|
|
|
In order for a document to be automatically opened by the correct application, the document resource identifier has to have the correct prefix that is specified under the HKEY_LOCAL_MACHINE.... Software....application name key within the registry of that machine.
This place persists all the info on a specific application.
When you create your application and a document with that application, the MFC library should assign the relevant resource ID to the new file and store it in the registry for you.
The start up code within the application sets the resource ID for you.
I hope this helps.
Joe
|
|
|
|
|
take a look at this Post[^]
I Dream of Absolute Zero
|
|
|
|
|
RChin wrote:
take a look at this Post[^]
Sorry, I need to get the hang of posting correct hyperlinks
I meant
This One[^].
I Dream of Absolute Zero
|
|
|
|
|
|
One solution is ShellExecute().
Kuphryn
|
|
|
|
|
|
i want to have a toolbar on the right hand and i want to add its buttons from right to left.please tell me how could i do it?
|
|
|
|
|
Hi!
I'm doing my first capture program and having an error message like:
/home/steve/tmp/ccNeGS6x.o(.text+0x1e): In function `main':
: undefined reference to `pcap_lookupdev'
/home/steve/tmp/ccNeGS6x.o(.text+0x7b): In function `main':
: undefined reference to `pcap_lookupnet'
collect2: ld returned 1 exit status
Does anyone know what is wrong?? I'm using the library pcap.h
|
|
|
|
|
You've included the header OK.
But you need to include the appropriate lib file to your project. If you look at
your documentation for pcap (I assume there is some!), it will point to a lib file
(e.g. pcab.lib). Just add the lib file to your project settings, and away you go.
Iain.
|
|
|
|
|
I am using a web browser control (actually the CHtmlStatic class found
in codeproject, but it's the same) to display some html and at some
point in my html document I have a button that calls window.print().
The problem is, if the option to print background colors and images
is not true in internet explorer's settings, my document will not print well.
So I need a way to get the registry key associated with that option
prior to displaying the html page, set it to true, show the page and
then set it back to the original value on return.
I have found the key:
HKEY_USERS\...(numbers ommited)...\Software\Microsoft\Internet Explorer\Main\Print_Background
which is probably the per user option, but how do I get and set it
at runtime?
Thanks in advance.
Have no fear of perfection - You will never reach it
|
|
|
|
|
You need the registry functions. Do a search for (e.g.) RegOpenKeyEx, and you will see the rest.
You will want:
RegOpenKeyEx
RegQueryValueEx
RegSetValueEx
RegCloseKey
Good luck,
Iain.
|
|
|
|