|
I need to do the same with Byte (VT_UI1), Short(VT_I2), float(VT_R4), and other VARIANT that what I have made with long (VT_I4).
How I can do it?
Thanks.
A part of the code:
for (long k=0;k<TOTALNUMPARAM;k++)<br />
{<br />
SafeArrayGetElement (PVAVLISTAVALORESPARAMETROS.parray,&k,&item);<br />
switch (item.vt)<br />
{<br />
case VT_UI1:<br />
break;<br />
case VT_I2:<br />
break;<br />
case VT_I4:
item.lVal = 0;<br />
if (input[parameter_start] == 0)<br />
{<br />
for (int l=parameter_start+1;l<(parameter_start+32);l++)<br />
item.lVal += input[l]*(int)pow(2,(parameter_start+32)-l-1);<br />
}<br />
else<br />
{<br />
for (int l=parameter_start+1;l<(parameter_start+32);l++)<br />
item.lVal += ((input[l]+1)%2)*(int)pow(2,(parameter_start+32)-l-1);<br />
item.lVal++;<br />
item.lVal *= (-1);<br />
}<br />
parameter_start += 32;<br />
SafeArrayPutElement (PVAVLISTAVALORESPARAMETROS.parray,&k,&item);<br />
VariantInit(&item);<br />
break;<br />
case VT_R4:<br />
break;<br />
|
|
|
|
|
Does anyone know how could I make the resource view support hebrew?
under "...\VC98\MFC\Include" I do not have a library "l.heb", does anyone where could I find a download for this?
|
|
|
|
|
Hi...
I'm trying to create a single flippable overlay surface with a specific pixel format. Here is this pixel format:
DDPIXELFORMAT ddpf = { sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_PALETTEINDEXED8, 0, 8, 0, 0, 0, 0};
In fact I want a 8 BPP surface... I've already try this format too:
DDPIXELFORMAT ddpf = { sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 8, 0xFF, 0xFF, 0xFF, 0};
But the result is the same... That's failed when I create the corresponding surface.
Why this failed?... I suppose that is a Hardware capabilities problem...
Thanks for all who can help me !!!
Hello World!!!
from Raphaël
|
|
|
|
|
Can you show us the code where you create the overlay surface!?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Yes I can....
It's a little big but here is:
Note that I work in windowed mode (not Fullscreen)...
CString str_err = "";
HRESULT ddrval = DD_OK;
DDSURFACEDESC2 ddsd;
int i = 0;
DDPIXELFORMAT ddpf = { sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_PALETTEINDEXED8,
0, 8, 0xFF, 0xFF, 0xFF, 0};
ZeroMemory(&ddsd, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_FLIP | DDSCAPS_COMPLEX | DDSCAPS_VIDEOMEMORY;
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_BACKBUFFERCOUNT | DDSD_PIXELFORMAT;
ddsd.dwWidth = MAX_DST_OV_WIDTH;
ddsd.dwHeight = MAX_DST_OV_HEIGHT;
ddsd.dwBackBufferCount = 1;
ddsd.ddpfPixelFormat = ddpf;
ddrval = lpDD->CreateSurface(&ddsd, &lpDDS_POVideo, NULL);
if(FAILED(ddrval))
{
str_err.Format("We couldn't create an overlay flippable surface? Code error %.8xh", ddrval);
MessageBox(str_err);
return FALSE;
}
DDSCAPS2 caps;
caps.dwCaps = DDSCAPS_BACKBUFFER;
caps.dwCaps2 = caps.dwCaps3 = caps.dwCaps4 = 0;
ddrval = lpDDS_POVideo->GetAttachedSurface(&caps, &lpDDS_BOVideo);
if( FAILED(ddrval) )
{
str_err.Format("lpDDS_POVideo->GetAttachedSurface failed with code %.8xh", ddrval);
MessageBox(str_err);
return FALSE;
}
I suppose that's OK... But the 8 BPP pixel format always failed...
I hope that it's what you want.
Hello World!!!
from Raphaël
|
|
|
|
|
Hello, I don't know how to get my child window maximized when my app starts!
Need help!!!
Thanks!
|
|
|
|
|
overwite the function ActivateFrame in your derived CMDIChildWnd class.
usually it is called CChildFrame...
implement it like this:
void CChildFrame::ActivateFrame(int nCmdShow)
{
// TODO: Speziellen Code hier einfügen und/oder Basisklasse aufrufen
nCmdShow = SW_SHOWMAXIMIZED;
CMDIChildWnd::ActivateFrame(nCmdShow);
}
|
|
|
|
|
Thank you!! It did the trick!
See ya!
|
|
|
|
|
Add a handler for WM_CREATE in CChildFrame and there ShowWindow(SW_MAXIMIZE);
|
|
|
|
|
Hello friends,
I am using a TVisualObject class given by Zoran M. Todorovic
I am able to split and place the tabs but one of the splitted window is occupying the entire space.I tried with changing the parametrew of CSize fn but its not working.i have attached the piece of code.Please suggest me to resize the window.
TVisualObject *pSplitter = new TVisualObject(1,"", 2, 1, pContext);
TVisualObject *pView1 = new TVisualObject(2,0,0,pContext, RUNTIME_CLASS(CDummyEdit), CSize(0,880));
TVisualObject *pView12 = new TVisualObject(13,0,0,1,2,pContext);
TVisualObject *pw12 = new TVisualObject(14,0,0,pContext,RUNTIME_CLASS(CDummyEdit),CSize(330,30));
TVisualObject *pw22 = new TVisualObject(15,0,1,pContext,RUNTIME_CLASS(CDummyEdit),CSize(0,80));
TVisualObject *pViewtab1 = new TVisualObject(3,1,0,pContext,RUNTIME_CLASS(TTabWnd),CSize(770,660));
TVisualObject *pTabView1 = new TVisualObject(4,"Log",pContext,RUNTIME_CLASS(CDummyEdit));
TVisualObject *pTabView2 = new TVisualObject(5,"Summary", pContext,RUNTIME_CLASS(CDummyTree));
//pTabView2->SetIcon(IDR_FINALTYPE);
m_Framework.Add(pSplitter);
m_Framework.Add(pSplitter, pView12);
m_Framework.Add(pView12,pw12);
m_Framework.Add(pView12,pw22);
m_Framework.Add(pSplitter, pViewtab1);
m_Framework.Add(pViewtab1,pTabView1);
m_Framework.Add(pViewtab1,pTabView2);
m_Framework.Create(this);
TVisualFrameworkIterator it(m_Framework);
while (!it.End()) {
TVisualObject *pObject = it.Get();
it++;
}
m_Framework.SetActivePane(pView12);
return TRUE;
|
|
|
|
|
I have not been able to find a simple way to show only the minimize or maximize buttons on the title bar. Whether or not I include WS_SYSMENU in the createstruct.style, it seems the WS_MAXIMIZEBOX and WS_MINIMIZEBOX bits only enable/disable the functions of the boxes, but they both seem to show regardless of the settings. Is there any simple way to show only one of the boxes? Or do I have to get out of MFC and create my own main frame window? Thanks for any suggestions.
|
|
|
|
|
Hi all,
I need to check in my MFC 7 application whether a particular directory exists.
How can I do this?
I know how to create a directory, but not how to check whether it exists or not.
Thanks so much!
-- narada
|
|
|
|
|
BOOL PathFileExists(
LPCTSTR pszPath
);
|
|
|
|
|
Thanks so much!
Just what I needed!
-- narada
|
|
|
|
|
how to create a modeless dialog window which behaves exactly the same as the "downloading window" from the Windws OS. what I really mean? I don't want this window to disapper when i minimize the main application. If i minimize the dialog I want to place it on the task bar, not on the main screen.
Waiting for your advices....
|
|
|
|
|
try making the modeless dialog a child of the desktop, not of the main application. do this in the "Create" call to the modeless dlg. that should fix the minimize issue you describe.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
This is my problem. I have to draw some lines over a media player control while it's displaying a video, and I can't do it. I just can do it if I don't load the video. Anyone can help me?
|
|
|
|
|
hello,
in CHtmlView how detect the user click on a link, and how get the link URL.
I want to block Ad popup, so i do :
void CSpy4WebView::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel)
{
*Cancel = true;
}
that's why i want to detect if the new window is ad, or if the new window is called by the user.
thx for your help.
|
|
|
|
|
|
Thx Joan,
i'm trying to understand your code but it is hard for me...
|
|
|
|
|
You are welcome, the article was written in order to get the feedback from other CPians, so ask whatever you need and tell me whatever you think that should be improved.
|
|
|
|
|
Hello,
I work with CHtmlView, and i want to know the url of activate frame.
You know how to get this ?
thx in advance
|
|
|
|
|
I want to get the range of a window from other app not my app.
I used ::GetScrollRange() function but always failed.
can anyone tell me whether i can get to the purpose or not?
if yes would you please tell me how?
your helpful advice will be apriciate.
|
|
|
|
|
friends ,
Can u help me with some code which will detect a file if it s aMPEG-1 file or not ????
|
|
|
|
|
Is it possible to convert const unsinged char* to unsinged char*. If yes tell me how.
Reply me soon
|
|
|
|
|