|
|
timothymfox wrote: Currently, my app makes registry entries that log the filetype and mimetype...
What registry keys/values have you changed?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
RIght now, the only registry keys are both done through the setup project in Visual Studio -- adding an association for my app's file extension in HKEY_CLASSES_ROOT, and the other one being the MimeType in the Content Types keys (HKEY_LOCAL_MACHINE/CLASSES/MIME/DATABASE/CONTENT TYPE/)
However, none of these registry entries are sufficient to automatically send the file type from Internet Explorer to my app -- currently that has to be done by the user, which is what I'm trying to change.
|
|
|
|
|
At a minimum, here are the registry keys/values you'll need. This example, timfox.exe, uses files with a .fox extension.
HKEY_CLASSES_ROOT\.fox = TimFox.Document
HKEY_CLASSES_ROOT\TimFox.Document\shell\open\command = TimFox.EXE %1
HKEY_CLASSES_ROOT\TimFox.Document\shell\open\ddeexec = [open("%1")]
HKEY_CLASSES_ROOT\TimFox.Document\shell\open\ddeexec\application = TIMFOX
; note: the application is optional
; (it defaults to the app name in "command")
HKEY_CLASSES_ROOT\TimFox.Document = TimFox Document
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi,
I have a simple dialog box that has an edit control. I want the dialog box to come up with the cursor in the edit box ready for input. I can do this using myDialog::UpdateDialogControls(pWndCtrl, TRUE) but then the focus is locked on the edit control and I can't use the OK or CANCEL buttons and I have to use the task manager to end the application. I have also tried the GotoCtrl(pWndCtrl) with UpdateData() and UpdateWindow() and some other variations that seemed like they might work but they have no effect at all. This is probably very simple, I just can't seem to figure out the right command sequence.
Buck
|
|
|
|
|
There should be a SetFocus() function you can use.
Danny
The stupidity of others amazes me!
|
|
|
|
|
BuckBrown wrote: I want the dialog box to come up with the cursor in the edit box ready for input.
The first control on the dialog that has an id other than IDC_STATIC will automatically get the initial focus. Otherwise, you'll need to call SetFocus() . If you opt for this, be sure and return FALSE from OnInitDialog() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Sorry, or SET SEL.
Danny
The stupidity of others amazes me!
|
|
|
|
|
Set the edit control to be the first item in the tab order (Crtl-D in VC6)
|
|
|
|
|
Thanks,
Although it would seem that GotodlgCtrl(pEditCtrl) followed by SetFocus() should do the trick it doesn't. It needs to be in the syntax of GotoDlgCtrl(pEditCtrl->SetFocus());
|
|
|
|
|
How to create icon in the tab controls tab?
Can anyone help me how to create the icon in the tab controls tab.
I mean I would like to add icon for the Tab controls tab beside the label. Is that possiable?
Nice talking to you.
|
|
|
|
|
Hi,
Check this[^]
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
I've read a lot that to make your window non-resizable that you need to remove the WS_THICKFRAME style, but I can't find here on Code Project, or MSDN, really how to do that. Can someone help me out?
Danny
The stupidity of others amazes me!
|
|
|
|
|
CAll GetWindowStyle() to retreive the style for the window.
Then mask out the WS_THICKFRAME ( style = style & ~WS_THICKFRAME );
Then set the windows style with the new style mask using SetWindowStyle().
THen call SetWindowPos(hwnd_, NULL,0,0,0,0, SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE);
This will cause the window to be updated properly so that the style change is reflected visually.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
bugDanny wrote: Can someone help me out?
Try:
BOOL CMainFrame::PreCreateWindow( CREATESTRUCT &cs )
{
if (! CFrameWnd::PreCreateWindow(cs))
return FALSE;
cs.style &= ~WS_THICKFRAME;
return TRUE;
}
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thank you both. The other answers I've read were much more complicated, so much thanks.
Danny
The stupidity of others amazes me!
|
|
|
|
|
Implement SQLXML Bulk Load using C++Implement SQLXML Bulk Load using C++
01 Dec 2005
Saint Paul, Minnesota
macgowan@pobox.com
Hi ...
I am trying to bulk load xml into sql server. This seems to be a relativly easy thing to do using the SQLXML COM Component. I am having trouble finding documentation on the SQLXML COM Object model. Also I have found samples in C# and VB ... I need my implementation to be using C++. If you have any sample code or a like you can send me to that would be create.
A good example of the type of doc that I am looking for is the object model for the MSXML COM Component
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceappservices5/html/wce50grfxmldomobjectsinterfaces.asp
Is there such documentation for the SQLXML COM
Below are the links I have used to date:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_sqlxml.asp
http://www.dbazine.com/sql/sql-articles/cook3
http://www.perfectxml.com/sqlxml.asp
Some code:
The code below uses the IXMLDOMDocument2Ptr interface and then trys to
use the SQLXML using the SQLXMLOLEDB Provider. Again, I need some doc
or samples on how to use the SQLXML COM Interfaces or the
SQLXMLOLEDB Provider in C++.
The code will fail on the following line
pCmd.CreateInstance(__uuidof(SQLXMLBulkLoad));
void CTestApp::OnTestMsXmlTest()<br />
{<br />
_ConnectionPtr pConnection = NULL;<br />
<br />
try<br />
{<br />
<br />
CoInitialize(NULL);<br />
IXMLDOMDocument2Ptr pXMLDoc = NULL;<br />
TCHAR szHTTPURL[MAX_PATH] = {0};<br />
<br />
_tcscpy(szHTTPURL, "http://www.buckeyetraffic.org/rwis/data/siteDetailS.xml");<br />
_variant_t varLoadResult((bool)FALSE);<br />
<br />
pXMLDoc.CreateInstance("Msxml2.DOMDocument.4.0");<br />
<br />
pXMLDoc->async = false;<br />
<br />
pXMLDoc->setProperty("ServerHTTPRequest", VARIANT_TRUE);<br />
<br />
varLoadResult = pXMLDoc->load(szHTTPURL);<br />
<br />
csResult =::SysAllocString(pXMLDoc->xml);<br />
<br />
<br />
<br />
pConnection.CreateInstance(__uuidof(Connection));<br />
<br />
CString csProvider("sqloledb");<br />
CString csDataSource("SQLTEST1");<br />
CString csInitialCatalog("TestData");<br />
CString csUserId("bill");<br />
CString csPassword("bluerayon");<br />
<br />
csConnect.Format("Provider='%s';Data Source='%s';",<br />
csProvider,<br />
csDataSource);<br />
csTemp.Format("Initial Catalog='%s';",<br />
csInitialCatalog);<br />
csConnect += csTemp;<br />
csTemp.Format("User Id=%s;Password=%s",<br />
csUserId,<br />
csPassword);<br />
csConnect += csTemp;<br />
<br />
bstrConnect = csConnect.AllocSysString();<br />
<br />
pView->WriteLog("Open ADO Connection.");<br />
<br />
pConnection->Open(bstrConnect,"","",adConnectUnspecified);<br />
<br />
_CommandPtr pCmd = NULL;<br />
<br />
pCmd.CreateInstance(__uuidof(Command));<br />
<br />
pCmd->ActiveConnection = pConnection;<br />
pCmd->PutPrepared(true);<br />
<br />
pCmd->Execute("SampleSchema.xml", "SampleXMLData.xml", adExecuteStream);<br />
<br />
}<br />
catch(...)<br />
{<br />
}<br />
<br />
CoUninitialize();<br />
return;<br />
}<br />
|
|
|
|
|
I need to implement a function to read application event logs in realtime. I have done this for our Unix server in Perl, but do not have the option of installing Perl on our Win32 production servers.
I have scoured (literally for days) the internet looking for any information on the best way to do this in C++ but haven't found anything! Any assistance or direction is greatly appreciated.
What I need to do is read these event logs and then send alerts or trigger other functions based on specific events. The log files are updated 10-100 times a minute depending on how many users are connected to the server so I need to continue monitoring the log even if I fork out to respond to event01. Make sense?
Thank you!
--Kenny
|
|
|
|
|
Sounds like you want to create an Event object ( see CreateEvent()[^]) wait on it in on place (thread) and then signal it from another when the log write occurs.
You can look into NT's event logging API's but I don't know if there are any performance issues for what you're intendending.
You can create teh event with a name, so that more than one process can wait on it.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
That definately seems to take care of the second part of my problem. Thank you!
Now do you have any advice on the most effecient way to read a log file that is being updated almost constantly?
|
|
|
|
|
Well just off the top of my head, if you're worried about access speed/io to the file, you could create a memory mapped file and then use that - then one process can write, another can read, without having to contantly open/close the file all the time.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
This is a bit too much C++ as I am mostly a Perl/PHP developer. I was hoping for something that I could do with simple file I/O. =)
I will look into it however.
Thanks!
|
|
|
|
|
Well then you could just open the file, and read from the end of it. Maybe keep track of the file size from the previous open, and compare to it's current size, and then read in the difference from the end. That's slower, and less complex, but makes heavier duty use of disk IO. Don't know how big a deal that is for you.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Kenny0323 wrote: This is a bit too much C++...
Actually, memory mapped files have nothing to do with C++. One thread/process will need to call CreateFileForMapping() (all others will need to call CreateFile() ). Call CreateFileMapping() , then use the pointer returned from calling MapViewOfFile() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Will NotifyChangeEventLog() help?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|