|
The resizing is due to the frame window, the view is a child of the framewindow.
Do this :-
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.style &= ~WS_THICKFRAME;
return TRUE;
}
Regards
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Another solution is to handle ON_WM_GETMINMAXINFO().
-----
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
{
// TODO: Add your message handler code here and/or call default
CFrameWnd::OnGetMinMaxInfo(lpMMI);
lpMMI->ptMinTrackSize.x = ...;
lpMMI->ptMinTrackSize.y = ...;
lpMMI->ptMaxTrackSize.x = ...;
lpMMI->ptMaxTrackSize.y = ...;
}
-----
Kuphryn
|
|
|
|
|
Does anyone know how to derive a CBitmap pointer to a CImageList entry, so that an individual list entry(image) can be access and manipulated ?
Cheers.
|
|
|
|
|
The function CImageList::GetImageInfo(int nImage , IMAGEINFO * pImageInfo) returns the image information of image at entry number nImage into pImageInfo .
The IMAGEINFO contains a member HBITMAP hbmImage , which is the handle to the image list's HBITMAP . The image list stores all the image in a single image strip, so there is another member RECT rcImage the contains the rect of the image inside the bigger bitmap. You may attach the hbmImage in a CBitmap then manipulate it within the given rect.
I have tried it and failed, but could not identify the problem. If it failed with you, then there will be no other way (as far as I know) except to create a new CBitmap then call CImageList::Replace() passing to it the image entry and the CBitmap pointer to set a new bitmap for the entry. If you need to retreive the image at an entry you may use CImageList::DrawEx() to draw the image at certain entry on a give DC
|
|
|
|
|
Yes, Ive tried the same thing already and it does not work for me either.
I think that I might just cut my ImageLists up into bitmaps just to make my life more easy !
As for DrawEx .. no good .. I need to construct complex images based on multipe images... for custom dragging and dropping!! oh well
|
|
|
|
|
Hi. Im having a rather stupid problem:
I have a Cwnd class that has a CTypedPtrArray variable. On a handler, i want to create a Modal dialog and intialize it with some values from the CTypedPtrArray variable in the parent. After i get a valid address to the parent, i can access any variable. My problem is when i try to access the objects in the CTypedPtrArray. The address from "m_array.GetAt(i)" returns ok but the class public variables have bad pointers. Even during normal dialog execution, i cant access it, although i can access all other parent's variable, including a normal pointer to an object of the same class of the CTypedPtrArray array.
Any suggestion?
thanks in advance
Miguel Lopes
|
|
|
|
|
How exactly are you getting a pointer to the parent? Is there any multithreading involved?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
There is no multithreading, at least for now.
Im creating it like this:
CMyParent* wnd=(CMyParent *)this->GetParent();
int size=wnd->m_array.GetCount(); //<----this works well
CString str=wnd->m_array[i]->m_inner_variable; //<--bad ptr, and its valid outside it!
/////////////////////////////////////////////////
ANOTHER EXAMPLE
i have an array of CMyObject; i created in the dialog a class member CMyObject* obj;
then, when i create in the parent window
CMyDialog dlg;
dlg.obj=m_array.GetAt(i);
then when i access "obj" from the OnInitDialog funtion, it works fine!!!
The problem is that by this way, i cant add it dinamically, except if i duplicate the whole array.
|
|
|
|
|
Hello? HELP!!! Im getting despered!!
|
|
|
|
|
Dears,
I´m trying to use createdirectory in visual c++ on a mfc application. I´m compiling this on .NET and i got a problem.
This function don´t run on windows 98 only in windows XP.
Some know how to solve this problem ?
Regards,
Luciano Fávaro
luc_favaro@yahoo.com.br
Luciano
|
|
|
|
|
|
This is the routine that i got a problem, it basiclly copy all files located in sPath to dPath.
The function CreateDirectory and CopyFile ar not running on windows98. I generated a log file and i discovered that on windows 98 the string dPath became invalid like:
original: "c:\teste"
garbage: "Y:\teste"
I read some articles and some of them indicate that the problem is Unicode conversion, but i try to follow the articles steps but it´s unusably.
One thing,
if in the function call CreateDirectory((LPCTSTR)dPath,NULL);
i change (LPCTSTR)dPath by a constant like "c:\\teste" the function run.
Please if you could help me, i´m thank,
LFávaro.
BOOL Cteste11Dlg::CreateTree(CString &sPath, CString &dPath)
{
CreateDirectory((LPCTSTR)dPath,NULL);
fstream f;
try
{
f.open("c:\\arq_log", ios::app);
// log para debug
// dt = _datetime_t::now();
//f << dt.fmt() << "DEBUG - Abriu arquivo de log\n";
}
catch (CFileException * pEx)
{
// log para debug
// dt = _datetime_t::now();
// f << dt.fmt() << "DEBUG - Ocorreu erro ao abrir arquivo\n";
TCHAR sz[1024];
pEx->GetErrorMessage(sz, 1024);
// log - erro gerado por excecao
// dt = _datetime_t::now();
//f << dt.fmt() << ERRO << sz;
pEx->Delete();
return FALSE;
}
f << "|" << (LPCTSTR)dPath << "|\n";
f.close();
CFileFind finder;
CString sWildCard = sPath + "\\*.*";
//CString sDestFile;
CFileFind finderDestFile;
BOOL bFound;
BOOL bWorking = finder.FindFile(sWildCard);
bFound = bWorking;
while (bWorking)
{
bWorking = finder.FindNextFile();
if (finder.IsDots())
continue;
if (finder.IsDirectory())
{
CString s = finder.GetFilePath();
CString temp=dPath+"\\"+finder.GetFileName()+"\\";
BSTR bstr2 = temp.AllocSysString();
BOOL a=CreateDirectoryW(bstr2,NULL);
DWORD d=GetLastError();
CreateTree(s,temp);
continue;
}
// copy files
if (CopyFile(finder.GetFilePath(),(dPath+"\\"+finder.GetFileName()), FALSE))
{
DWORD dwAttrs = GetFileAttributes(finder.GetFilePath());
if (!(dwAttrs & FILE_ATTRIBUTE_READONLY))
{
SetFileAttributes((dPath+"\\"+finder.GetFileName()),
dwAttrs | FILE_ATTRIBUTE_READONLY);
}
}
/*else
{
DWORD l=GetLastError();
MessageBox("Couldn't copy file.");
} */
}
return bFound;
}
LFávaro
|
|
|
|
|
luc_favaro wrote:
I generated a log file and i discovered that on windows 98 the string dPath became invalid like:
original: "c:\teste"
garbage: "Y:\teste"
Hmmm, this looks like you are overwriting memory somewhere, a bad pointer perhaps. The problem is not with CreateDirectory or CopyFile. If you corrupt the string that you pass to those functions, then obviously they will fail. Trace through your code and try and locate when the string that you pass gets corrupted.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Hi folks..
I've created an activex control for a website that uses javascript to fetch data..
Now, the problem is that i can't manke that control DO anything even though the function is added to the project..
My question is HOW to create "PUBLIC" functions to use on my website..
This is what i'm using on the website..
<br />
<script><br />
<br />
function winamp() {<br />
<br />
myStr = MyControl.MyFunction;<br />
<br />
alert(myStr);<br />
<br />
return;<br />
}<br />
<br />
</script><br />
<br />
<br />
<OBJECT ID="MyControl" WIDTH=0 HEIGHT=0 CLASSID="CLSID:3BD88955-B9EB-4185-9F47-FEA07F6109B8"><br />
<PARAM NAME="_Version" VALUE="65536"><br />
<PARAM NAME="_ExtentX" VALUE="2646"><br />
<PARAM NAME="_ExtentY" VALUE="1323"><br />
<PARAM NAME="_StockProps" VALUE="0"><br />
</OBJECT><br />
<br />
This *SHOULD* give an alertbox - saying "Hello World".. but i get "Object not supported"
I really need some help!
|
|
|
|
|
In javascript, you neeed to use the parens when calling functions. Change your call to myStr = MyControl.MyFunction(); and see what happens.
Ron Ward
|
|
|
|
|
|
Are you certain your activex control is registered on your client machines and that the users have turned all the security options dealing with unsigned controls on from within IE? Because what you've done should work; assuming your GUID is a valid control on the client PCs. If the control is proplery constructed, you should be able to reference the .object variable:
if( MyControl.object == null )
alert('Control not found');
Ron Ward
|
|
|
|
|
Hello,
I want to start learn HOOK, but all the tutoials I see here, is in Visual C++ 6, I prefer to start directly from Visual C++.NET.
Where can I start?
Thank's,
Itay.
|
|
|
|
|
|
Hello
I need a view class that can show formatted text with pictures, tables and font colors in two columns (MSWord-like with text flowing from one column to another) with page divisions.
It can be read-only, but with copy operation support.
I was adviced that I can use PDF format in some way.
Can anyone help me with at least a starting point to look for info - some MFC classes, custom controls or articles and sites in inet?
Thank you in advance
|
|
|
|
|
Cant you execute MSWord?
Archigal wrote:
It can be read-only, but with copy operation support.
Copy and paste seems to rule out any pdf-renderer like ghostview.
Only copy may or may not work with pdf (rendering results in a graphic!)
Maybe the easiest would be generating HTML and starting an IE on it?
(You could even design your own XML-dialect and use XSLT to make HTML from it)
You have endless possibilities , but it seems what you want is a several weeks project requiring some degree of experience (or learning on the fly, extending the time).
< edit >RTF (rich text format) might help you. I am sure it can do columns, and a renderer should be somewhere in the web (OpenOffice?)< /edit >
Hope this has helped (and not shattered your dreams).
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Hello,
how can i get the Geteway IP Address ( or List ) in a Windows NT system.
Thanxs
Marco
|
|
|
|
|
I'm trying to write a small program that shovels search parameters into Kazaa and then initiates a search. Almost a dynamic macro
I'm fairly new with Visual Basic and C++, and I while I understand basic DLL structure, I am confused as how I can control one program through another.
Any thoughts or ideas? I know I'm missing something.
|
|
|
|
|
If you want to do it for fun, do it, but if not (if you need it, try to download kazaalite 2.02 that includes that external utility)...
After having said that...
1. If kazaa gives you any DLL with some methods, you should use it.
2. If kazaa don't give you any DLL or OCX... you should intercept windows messages and throw the same (or other) messages to the application parts (I think...)
Hope this helps...
|
|
|
|
|
This is actually even pretty simple.
You search for the Kazaa window with FindWindow or EnumWindows .
Once you found the window, you search for the Kazaa client windows, namely the search edit field and search button with EnumChildWindows .
You enter the search text with SendMessage(wndSearchField, WM_SETTEXT, text, strlen(text)) and simulate a button press like that: SendMessage(::GetParent(wndButton),WM_COMMAND,MAKEWORD(::GetDlgCtrlID(wndButton),BN_CLICKED),(LPARAM)wndButton);
Hope this helps!
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|