|
It is not the attributes but the dll itself cannot be opened.
( I tried differenct attributes, still doesn't work)
|
|
|
|
|
If i write this:
char *szFileNameOnly[999];
will all the char pointers be initialized to zero or do i have to do that myself?
Thanks
|
|
|
|
|
you will have to do that yourself. C/C++ doesn't initialize anything for you (unless it has a constructor, or if you're in debug mode using MSVC's compiler).
-c
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
Gosh, you typed faster than me
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
|
Come on, add to my frustation
PS: Excellent strings tutorial.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You have to do it yourself.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You should always initialize variables when declaring them.
Max.
|
|
|
|
|
C++ doesn't automatically do it for you, but it does have easy ways for you to do it. This statement will cause all the pointers to be initialized to zero:
char *szFileNameOnly[999] = {0};
Chris Richardson
|
|
|
|
|
Thanks for you advice. Can this also be done when the variable has already been declared? If so, how? Cause I'm getting an error when trying to do it.
|
|
|
|
|
If you want to zero all the pointers after the variable has been declared, you can use memset:
memset( szFileNameOnly, 0, sizeof( szFileNameOnly ) );
Chris Richardson
|
|
|
|
|
I have a COM DLL built with VC++6 and it has dialog resources using activex controls such as MsFlexGrid and CTreeCtrl etc.
I have two main applications(AppSimple and AppWithLotOfDlgResources) that can use this dll.
When I use AppSimple to call this Dll, it works fine both in Debug and Release modes.
The problem is when I use AppWithLotOfDlgResources application as the calling program, I am getting "Unsupported operation" only in RELEASE build.
Q. Is there some kind of a conflict in resources between the DLL and the AppWithLotOfDlgResources ?
Please help
Thanks
|
|
|
|
|
When I do stuff like:
POSITION pos = pDoc->GetFirstViewPosition();
while (pos!=NULL)
{
CView* pView = pDoc->GetNextView(pos);
I dont have the second view created or instantiated. Yet the code still works. Is this weird? Does the doc automatically know which views it has even if I dont do:
pChild = (CMDIChildWnd*) pTemplate->CreateNewFrame(pDoc, NULL );
if( pChild == NULL ) return FALSE;
pChild->MDIActivate();
pTemplate->InitialUpdateFrame( pChild, pDoc);
on it? (I do the createframe when I switch views). Am I creating the view here? I've used the first snippet even when the second snippet has not been executed..and it works
Appreciate your help,
ns
|
|
|
|
|
here's my OPENFILENAME struct:
char szFileNames[(MAX_PATH+1)*1000+1];
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = ghWnd;
ofn.hInstance = ghInstance;
ofn.lpstrFilter = "All Files (*.*)\0*.*\0";;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = NULL;
ofn.nFilterIndex = 1;
ofn.lpstrFile = szFileNames;
ofn.nMaxFile = (MAX_PATH+1)*1000+1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = NULL;
ofn.lpstrInitialDir = "C:\\";
ofn.lpstrTitle = "Open File(s)";
ofn.Flags = OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_EXPLORER | OFN_NODEREFERENCELINKS | OFN_NONETWORKBUTTON;
ofn.nFileOffset = NULL;
ofn.nFileExtension = NULL;
ofn.lpstrDefExt = "*.*";
ofn.lCustData = NULL;
ofn.lpfnHook = NULL;
ofn.lpTemplateName = NULL;
ghWnd is a valid handle to my main window and ghInstance is also a valid handle to my apps memory block
When i run the GetOpenFileName function it returns false, and a call to GetLastError returns "invalid parameter", what am i doing wrong?
Thanks
|
|
|
|
|
Hi,
I am using VC++ 7.0 and am trying to load an icon, which I have as one of my resources, into my button. The button is created dynamically.
Here is the code that I have:
button->Create("SMS", WS_CHILD | WS_VISIBLE | BS_FLAT | BS_ICON,
CRect(0,0,0,0), &m_wndStatusBar, IDC_BUTTON_STATUS_BAR);
button->SetIcon(::LoadIcon(NULL, MAKEINTRESOURCE(IDI_ICON1) ) );
This does not seem to work. I know it worked in VC++ 6.0.
Can anyone help me out here?
Thanking you in anticipation
Rui
|
|
|
|
|
m_ctrlViewList.SetIcon(AfxGetApp()->LoadIcon(IDI_VIEW_LIST));
which m_ctrlViewList is a CButton, more...the icon size is in 32 pixel
==================
BTW, if you want set a other size of icon, like 16*16 size, you can code like this..
//.h file
CImageList m_ButtonImages;
//.cpp file
m_ButtonImages.Create(16,16,ILC_COLOR32 ,2,2); //create you icon list
m_ButtonImages.Add(AfxGetApp()->LoadIcon(IDI_VIEW_ICON ));
m_ButtonImages.Add(AfxGetApp()->LoadIcon(IDI_VIEW_LIST ));
m_ctrlViewIcon.SetIcon( m_ButtonImages.ExtractIcon(0));
m_ctrlViewList.SetIcon(m_ButtonImages.ExtractIcon(1));
modified 21-Aug-12 22:10pm.
|
|
|
|
|
THis is what I want to do: clear a listbox in view2, and repopulate it.
POSITION pos = pDoc->GetFirstViewPosition();
while (pos!=NULL)
{
CView* pView = pDoc->GetNextView(pos);
ASSERT_VALID(pView);
pView->m_list1.DeleteAllItems();
pView->PostMessage(WM_COMMAND, IDC_BUTTONHIDEV2,0);
}
THis line gives an error error C2039: 'm_list1' : is not a member of 'CView'
pView->m_list1.DeleteAllItems();
My View class is called TView1. How do I make this work?
Appreciate your help,
ns
|
|
|
|
|
TView1* pView = (TView1 *)(pDoc->GetNextView(pos)); or if you like the C++ cast syntax:
TView1* pView = static_cast<TView1 *>(pDoc->GetNextView(pos));
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Actually the class that has the listbox is called CDlgList.
With great trepidation I did the cast as
CDlgList* pView =
and it worked!
thank you,
Appreciate your help,
ns
|
|
|
|
|
try casting to ur own view
{
CYourView* pView = (CYourView*)pDoc->GetNextView(pos);
ASSERT_VALID(pView);
pView->m_list1.DeleteAllItems();
pView->PostMessage(WM_COMMAND, IDC_BUTTONHIDEV2,0);
}
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I have done some test to send and receive bitmap with socket but i have problem;
if somebody has some idea can response.
|
|
|
|
|
For the client server i recomend u using:
http://www.codeproject.com/internet/ndk.asp
The just read the file into a buffer and send it to the client
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
I have embedded a property sheet inside CFormView and have inserted several Property Pages. I want to access data in the first property page from the 2nd Page?
Any suggestions?
Kash
|
|
|
|
|
((CMySheet*)GetParent())->m_Page1
Pavel
Sonork 100.15206
|
|
|
|