|
V. wrote: Try defining your foo function like this:
void foo(TCHAR* t){
//Do stuff here
}
Thanks, but I want foo to be a function that accept a pointer to a pointer variable. But in you case I believe it was a pointer to TCHAR.
-- modified at 4:42 Wednesday 5th April, 2006
|
|
|
|
|
LiYS wrote: "cannot convert...",
cannot convert....//what.
Please give full error message.
Nibu thomas
Software Developer
|
|
|
|
|
Nibu thomas wrote: Please give full error message.
t.cpp(16): error C2664: 'foo' : cannot convert parameter 1 from 'TCHAR (*__w64 )[14]' to 'TCHAR ** '
-- modified at 4:40 Wednesday 5th April, 2006
|
|
|
|
|
Try this...
void foo(TCHAR** t)
{
size_t tt = sizeof(*t);
}
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR* szForRequestData = TEXT("ForRequestVar");
foo(&szForRequestData);
return 0;
}
Nibu thomas
Software Developer
|
|
|
|
|
It passed compilation, but the questions boil down to:
1.what's the difference between
TCHAR* szForRequestData = TEXT("ForRequestVar");
TCHAR szForRequestData[] = TEXT("ForRequestVar");
|
|
|
|
|
in the second case (empty []) it creates an array which size is fixed by the assigned value...
|
|
|
|
|
LiYS wrote: TCHAR* szForRequestData = TEXT("ForRequestVar");
in this case the starting address of the string is stored in the TCHAR* szForRequestData
LiYS wrote: TCHAR szForRequestData[] = TEXT("ForRequestVar");
in this case the starting address of the string is represented/indicated by szForRequestData
never say die
-- modified at 6:24 Wednesday 5th April, 2006
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Because the built-in conversion from "array of X" to "pointer to X" only applies to one-dimensional arrays. You're expecting that conversion to apply everywhere, which it doesn't. "pointer to array of X" doesn't convert to "pointer to pointer to X"
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I tried to compile a simple unicode DLL, in both Release and Debug mode. This DLL, when called will show a message box with some unicode text. The Debug mode DLL works very fine. The release mode DLL is crashing after I call it the first time. I do not understand this. What exactly should I do to make the Release mode DLL work fine? I have read Joseph M. Newcomers essay about Release Vs debug. I did not find my answer in that. I am not using any variables any structures, etc.
Regards,
Aljechin Alexander
|
|
|
|
|
The answer is probably in the essay you 've already read! You provide very little information to anyone be able to give you an aswer. Try to figure out at what line of code the dll crashes. The most probable reason for the crash is an uninitialized variable.
|
|
|
|
|
Sir , I want to Know Why DataBase Application is giving a Error As CRecordSet Base Calss Undefined? and how can i fix it.
What i did is as follows
1)I have Taken a SDI App with its Views BaseClass as CFormView.
2)Derived new Class From CRecordSet named CStuRecSet and Selected Corresponding Data Source.
3) and Later I Declared and Object of m_StuRecSet of type CStuRecSet in Document Class.
sir pls tell how to clear this error(CRecordSet Base Class Undeclared)
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
satishvarma_e wrote: sir pls tell how to clear this error(CRecordSet Base Class Undeclared)
Because you haven't included afxdb.h .
Nibu thomas
Software Developer
|
|
|
|
|
Hi,
I am trying to have two views on file new on the same document and initiate windows tile command. I put the following code in the CChkBookApp::initinstance function at the bottom after all templates and window is created. But I get error. How to solve this. Thanks lee
CChkBookDoc* pDoc = (CChkBookDoc*)pMainFrame->GetActiveDocument();
if (pDoc == NULL)
return NULL;
CFrameWnd* pNewFrame = m_pCheckViewTemplate->CreateNewFrame(pDoc, NULL);
if (pNewFrame == NULL)
return pDoc;
m_pCheckViewTemplate->InitialUpdateFrame(pNewFrame, pDoc);
// Tile the two MDI children windows within the MDI frame window.
ASSERT_KINDOF(CMDIChildWnd, pNewFrame);
CMDIFrameWnd* pMDIFrameWnd = ((CMDIChildWnd*)pNewFrame)->GetMDIFrame();
ASSERT(pMDIFrameWnd != NULL);
pMDIFrameWnd->MDITile(MDITILE_HORIZONTAL);
|
|
|
|
|
yang__lee wrote: But I get error.
What is the error!
Nibu thomas
Software Developer
|
|
|
|
|
If the error comes when you create the new view then
the code that you can find in
CMDIFrameWnd::OnWindowNew()
is a good example to open correctly a window on a MDI application.
The tile operations looks ok.
Have a nice code day
|
|
|
|
|
I am a beginner of MFC.
this time i want to use MFC wizzard with MDI.
I add
cs.style |=WS_MAXIMIZE;
cs.style &= ~(WS_MINIMIZEBOX| WS_MAXIMIZEBOX )
in CChildFrame::PreCreateWindow()to create childframes maxmized when they are created.and disable the MINIMIZEBOX and MAXIMIZEBOX .
when child frame is created,it did show with maxmized;
I clicked the minmize button at the system menu(not in childframe title),it doesn't work(&~WS_MINIMIZEBOX),
the problem is:when i clicked the maxmize button at system menu,child frame resized and placed to the full client of the Mainframe.
and there is no minmize and maxmize button on the title of child frame.
That's why? i had added the "&~WS_MAXIMIZEBOX ".
Who can help me .
I will appreciate much!
bruspark
-- modified at 1:23 Wednesday 5th April, 2006
|
|
|
|
|
Can you be more specific as to what you wish to do.
Nibu thomas
Software Developer
|
|
|
|
|
Hi,Nibu
Here is what i want to...
first,make each MDIChildFrame show in the client of MainFrame with maxsize.next time when i switch between the childframes,they should also show with maxzize.
second,I wish to disable the maximize button minimize button on the child frame,but the close button should be usable.
any one who know please tell me.
Waiting for your reply.Thanks!
Bruspark
|
|
|
|
|
bruspark wrote: first,make each MDIChildFrame show in the client of MainFrame with maxsize.next time when i switch between the childframes,they should also show with maxzize.
Add a message map entry for ON_WM_CHILDACTIVATE .
Override OnActivate(int nCmdShow);
Call ShowWindow inside OnActivate
eg: ShowWindow(SW_MAXIMIZE);
bruspark wrote: second,I wish to disable the maximize button minimize button on the child frame,but the close button should be usable.
Override PreCreateWindow and add this line
cs.style &= ~WS_SYSMENU;
//Well this removes the close button too.
Nibu thomas
Software Developer
|
|
|
|
|
Thank you for your reply!
I have tried your method. It workes!!Thanks a lot!
I overide the PreTranslateMessage() fuction to catch the SC_RESTORE message and do nothing ,so the maximize button (in fact it is restore button.) doesn't work when you click it..
bruspark
|
|
|
|
|
bruspark wrote: I overide the PreTranslateMessage() fuction to catch the SC_RESTORE message and do nothing ,so the maximize button (in fact it is restore button.) doesn't work when you click it..
Great idea!
Nibu thomas
Software Developer
|
|
|
|
|
Is ther any function in MFC to get the break character position (i.e position in the text at which the text breaks for word wrapping).
Kindly let me know
Thanks
|
|
|
|
|
line break character?
which are "\r\n" (2 chars - notepad) or '\n' (1 char - richedit).
functions are:
strstr(...) and strchr(...) for position.
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|
|
Is ther a way to get the exact width of any character in a text i.e LOGFONT .
I do not want the average width or the maximum/minimum width.
if ne1 does know then
Kindly reply to tis msg
Thank u
|
|
|
|