|
Hi, all
i added a datagrid control(Microsoft DataGrid Control version6.0(oledb)) to my dialog, but i don't know how to set the values in the cells, should i call something before i call SetText()?
Thanks;)
|
|
|
|
|
You dont need to call anything before SetText()...
just make sure you have set the control variable for the Grid and that you are in the correct cell that you want to set your text to.
If you want a helping hand, you'll find one at the edof your arm.
|
|
|
|
|
but what "the control variable for the grid" should be set? could u provide some simple code?;)
|
|
|
|
|
Hi,
I'd like to replace CreateThread() with beginthreadex() , but I get an unknown identifier error.
process.h is included, anything else I need to do?
|
|
|
|
|
|
You must link with the multithreaded lib , or else you get errors ..
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
Joao Vaz wrote:
You must link with the multithreaded lib , or else you get errors ..
ah yes, found it. thx!
Can I use a pragma to link with the multithreaded DLL? Something like #pragma comment(lib, "xxx.lib") , what do I need to set for xxx?
Which alternative is better: 'Multithreaded' or 'Multithreaded DLL'? Last one makes executable much smaller, does it run on Win9x/2000/XP still?
|
|
|
|
|
I'll use something like this:
BOOL createthread(HTHREAD* phThread, ThreadStartFunction pThreadFunc, void* pThreadParameter)
{
assert(phThread && !*phThread);
#ifdef _MT
unsigned int nDummy;
*phThread = (HTHREAD) _beginthreadex(NULL,0,pThreadFunc,pThreadParameter,0,&nDummy);
#else
unsigned long lDummy;
*phThread = CreateThread(NULL,0,pThreadFunc,pThreadParameter,0,&lDummy);
#endif
return *phThread?TRUE:FALSE;
}
|
|
|
|
|
Hi guys, I need a few pointers on file associations. I'm trying to write an app that decrypts files of a certain file extension, lets's say the extension is ".abc". I want that when someone clicks on the encrypted file, say "MyEncryptedFile.abc", it is opened via my decryptor. My question is, do I need to pass that file name to my decryptor exe and if so...how? Or, is there no need for this since files of type ".abc" are associated with my exe?
Hope that makes sense.
Senkwe
Just another wannabe code junky
|
|
|
|
|
Senkwe Chanda wrote:
My question is, do I need to pass that file name to my decryptor exe and if so...how?
It depends on how you have set up the string in the registry.
For an example see :-
HKEY_CLASSES_ROOT\txtfile\shell\open\command
It'll show you how a txt file is opened by notepad
The value is :-
%SystemRoot%\system32\NOTEPAD.EXE %1
Thus the %1 will automatically be sent to notepad.exe as a cmdline parameter where %1 is the file that has been double-clicked or opened from explorer
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Thanks Nishant, am I limited to only passing through the filename? Suppose I required two command line parameters for the exe, the file name and a password for example.
If you can, please point me to a good site where I can get more info on the topic.
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
You have to look at shell programming, take a look at it in MSDN.
|
|
|
|
|
make sure u close the File Handle before open next time..
Renjith-The CPian.
|
|
|
|
|
showing us some actual *code* might help.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
I ran into something similar to this with memory mapped files. It turns out that I had to create the memory mapped file (wrapper) object dynamically even though I saw that the destructor for the object that contained the static file object was executing correctly.
So, I did a "myFileObj = new FileObj;" and a "delete myFileObj" in the destructor and then it actually closed the file. Wierd, huh? But, that was the solution.
|
|
|
|
|
em wrote:
ifsFile.open(ListPath, ios::nocreate);
Get rid of ios::nocreate. You don't need it.
em wrote:
I've set a breakpoint on ifsFile.close();
That's dumb. Set a breakpoint at the start, then you'll find out if the file was good on the way through.
em wrote:
if (ifsFile)
Get rid of this as well.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
If I use the AppWizard to create an MDI applicaiton. It'll open a document at first. How can i disable the initial document/childview/childframe creation ? I'll create myself in the Menu by using DocTemplate->CreateNewFrame()
|
|
|
|
|
Put this code in your InitInstance()
if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew)
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing ;
Before the call to ProcessShellCommand()
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
网络安全组件让你开发更轻松,省事少力!
网安卫士http://ww.nsguard.com ,本站提供应用层防火墙开发包,文件保护和监视开发包,进程与SOCKET端口关联开发包.....等各类网络用应用和网络安全相关的组件并提供各个开发工具的开发接口,欢迎各位参观,切磋,合作!
邮件 digitalbrain@163.com
icq 1606664478
qq 15614487
|
|
|
|
|
I dunno, but it sure looks cool. I reckon there's more than 26 characters in this post alone, learning to write this language must be a hell of a challenge. Not to mention how big your keyboard must be !!!
With all those words, you'd think they'd have one for socket
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
|
GetTextExtentPoint32 returns the text size in pixels but it is always the clipped to the window extent. I want the total size of the text which doesnot fit completely in the window. Any idea how this can be done?
|
|
|
|
|
Can't you just call CDC::GetTextExtent(text)?
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
If I begin a process A from windows and then begin a process B from windows instead of using the CreateProcess() or ShellExecuteEx() functions to spawn process B from process A. How can I get the process B handle to stop process B in process A? Should windows keeps all the process handles have launched for this kind of operation? Thanks.
Kidd
|
|
|
|
|
OpenProcess.
If you only have a process name you first need to look up the PID using some API such as PSAPI. Unfortunately there is no "portable" way to do this within the Win32-family of OS'es, though I think there's some code for it here on CP.
|
|
|
|