|
To all three of you who suggested that I add the resource.h file ---- THANKS.
What can I say but DUH!! Sometimes it's too obvious??
Thanks again!
John P.
|
|
|
|
|
#include "resource.h"
hello
|
|
|
|
|
#include "resource.h" before the class declaration.
MANISH RASTOGI
|
|
|
|
|
hi all,
can any one provide any info about searching for files using regular expressions.
something like [a-z]+[0-9].[a-z][0-9].
please provide links to any white papers or articles.
thanks,
sombhotla.
|
|
|
|
|
Hello,
How can I use com written in vc6 from c++.net managed code?
Thanks,
|
|
|
|
|
Hi!
I have a function which returning me LPCST i.e char*.
I want this value to be stored in array of 255 chars decleared as :
char Arr[255];
how can i do this ??
Thx in advance
|
|
|
|
|
Returning a char array this way is tricky. Either you have to allocate the memory inside the function and free it outside (which is very ugly), or you can pass the pointer as a parameter of the function and manipulate its content. Anyway, it is much better to use the std::string (from the Standard Template Library) for which you don't need to care about memory usage.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
If you can modify the function (that is, you control it), you can make the return value part of the function arguments:
void getMyString(char[255]& retString)
{
memset(retString, 0, 255);
strncpy(retString, srcString, 254);
}
If you don't have access, or are not allowed to change the interface, here are some alternatives:
char buffer[255] = {0};
strncpy(buffer, myFunction(), 254);
std::string myString = myFunction();
Note that both of those can be sketchy if the returning function is allocating memory on the heap and expecting you to handle cleanup (very poor design, but not too uncommon, sadly). Just keep that in mind when dealing with this kind of thing.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: void getMyString(char[255]& retString)
That won't work.
|
|
|
|
|
You are correct. Sorry, it should have been:
void getMyString(char retString[255])
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
MSDN document says.
-------------------
Maximum Path Length
In the Windows API, the maximum length for a path is MAX_PATH, which is defined as 260 characters. A path is structured in the following order: drive letter, colon, backslash, components separated by backslashes, and a null-terminating character, for example, the maximum path on the D drive is D:\<256 chars>NUL.
The Unicode versions of several functions permit a maximum path length of approximately 32,000 characters composed of components up to 255 characters in length. To specify that kind of path, use the "\\?\" prefix.
How do we create a file with path name more 260 characters ?.
============================================================
Lokesh
HP
|
|
|
|
|
I need to write the code to move data inputted by the user, to a SQL database... can anyone help me start this.... i'm not too familiar with visual studio yet
Cheers .. Phil
|
|
|
|
|
i want to know that CTTListBox is not in the listbox type as i want to declare a variable of this type.
when i decalare this directly or by changing CListBox type then it gives error
plz tell me how can i use this
Ashish Dogra
MCA
Noida
|
|
|
|
|
|
hi all,
i wantto create a Splitter View Please help me out.
thanks and regards,
uday.
|
|
|
|
|
Call OnCreateClient in you CMainFrame class and make the changes approprialtely.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic(this, 1, 2))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
if (!m_wndSplitter.CreateView(0, 1,
pContext->m_pNewViewClass, CSize(0, 0), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}
if (!m_wndSplitter.CreateView(0, 0,
pContext->m_pNewViewClass, CSize(200, 0), pContext))
{
TRACE0("Failed to create second pane\n");
return FALSE;
}
SetActiveView((CScrollView*)m_wndSplitter.GetPane(0,1));
return true;
}
Hope that helps.
Fortitudine Vincimus!
|
|
|
|
|
Hi,
I want to add some code when the 'X' button on the top right of a dialog box is pressed. For example if the window size is changed, maximises/minimised we add the code in OnSize() function (WM_SIZE).
Please can you tell me how to know when the 'X ' button is pressed.
Thanks,
Tara
Fortitudine Vincimus!
|
|
|
|
|
Handle WM_CLOSE Message.
Jubin Chawda
braindrain1@rediffmail.com
-----------------------------
Come online at:-
fitiyal@yahoo.com
|
|
|
|
|
Yes, of course!! Silly of me. I did not see properly.
Thank you.
Fortitudine Vincimus!
|
|
|
|
|
yes you can useWM_CLOSE if this is your question or you want to write your button instead Close button
whitesky
|
|
|
|
|
I want a message box to appear asking the user if he wants to save his work when he closes the dialog box.
Fortitudine Vincimus!
|
|
|
|
|
int int nIndex=MessageBox("Are your sure to exit,"Question",MB_YESNO); and check return value
whitesky
|
|
|
|
|
Yes. Thank you.
Fortitudine Vincimus!
|
|
|
|
|
Hi All
I am having a problem in my application, what I am doing is:
Calling a function SaveKeys(TCHAR *) within a loop and this function save the specified registry key to a .reg file,
for this using CreateProcess( ) for calling regedit.exe from command line and WaitForSingleObject( ) function.
code looks like this
<br />
for (int i = 0; i < 10; i++)<br />
{<br />
SaveKeys(cRegistryKey );
}<br />
<br />
void MyClass::SaveKeys(TCHAR *cRegistryKey)<br />
{<br />
STARTUPINFO StartupInfo;<br />
PROCESS_INFORMATION ProcessInformation;<br />
<br />
CreateProcess(NULL, cCommand,NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE|CREATE_SUSPENDED,NULL, NULL, &StartupInfo, &ProcessInformation);<br />
WaitForSingleObject( ProcessInformation.hProcess, INFINITE );<br />
<br />
}<br />
Now what is my problem is that here WaitForSingleObject( ) function is not working. and only a single reg file is created.
and when use Sleep(1000) then all the 10 reg file are created.
So please tell me that how should I overcome this problem.
Please reply
Thanks
|
|
|
|