|
How so, Mike? It sounds as though the second machine indeed has Visual Studio on it.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Just a wild guess, I really had no concrete ideas from reading his post. Should I not have done that?
led mike
|
|
|
|
|
More often than not, the answer to "Why won't my VC++ application run on a machine other than the one it was compiled on?" is either the reason you stated, or the application was mistakingly compiled in debug mode. However, he indicated that both machines had VS installed. I'm still baffled.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: he indicated that both machines had VS installed.
Not all installations of VS are equal, for example a Platform SDK difference. No reason to be baffled given the lack of information we have, this thread calls for a
led mike
|
|
|
|
|
led mike wrote: Not all installations of VS are equal, for example a Platform SDK difference.
But didn't the code compile fine on both machines? If the code was using something specific to the SDK or the DDK, and one of the machines did not have that, I would expect a compile error, not a run-time error.
led mike wrote: ...given the lack of information we have...
Agreed.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dear all
I have a set up for a multithread application that works with Sound Card and it uses Socket Connection. this set up works perfectly on a computer with these specifications:
motherboard: ASUS P4P800-MX Model
Processor: Intel Celeron CPU 2.53GHz
Memory: 512 MB , GEL brand
Hard Disk: 80GB Maxtor , IDE
Sound Card: Creative Sound Blaster 24 bit
but when mentioned setup run on another computer , this application occur many different exceptions e.g. some times some Icones hide or access violation.
second computer specifications:
Motherboard: ASUS P5GC-MX/1333 Model
processor: Intel Pentium D 2.8GHz Dual-Core Processor
Memory: 512 MB , Kingstone brand
Hard Disk: 80GB Maxtor, SATA
Sound Card: Creative Sound Blaster 24 bit
I was changed OS, RAM ,Motherboard BIOS , Power supply, Sound Card and used another VGA ... but the problems remain.
the application wrote with Delphi7 .
any body have suggestion?
|
|
|
|
|
e_yp wrote: the application wrote with Delphi7
C++ forum != delphi forum.
I know little about delphi, but I assume it will be heavily dependent on the delphi libraries being the same.
Can you compile / link your program statically, so that all the dephi stuff and your code end up in a big exe?
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Iain Clarke wrote: Can you compile / link your program statically, so that all the dephi stuff and your code end up in a big exe?
That's the default setting (or used to be).
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
I suspect the problem is in your threading code, and that you're not seeing it because you are running on a single core and the multi-threading is not being "exercised" in the same way that it is on a true SMP system like the Core Duo. More importantly few people are going to be able to help you here because your code is in Delphi, not C++, and not alot of people here are very familiar with it. Check out the Borland forums, and do some serious code review on your multi threaded code.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Hi All,
I need your help guys. I'm trying to implement a custom list box that will only have images, the images are 50 x 62 pixes 32bit. The thing is that, all the images that I want to display are all stored on single bitmap. This bitmap is quite large, has about 300 of the images and the bitmap file is loaded during the run time. I have the bitmap already loaded in memory and I use other elements from the bitmap file to draw on the screen. I know the coordinates of each image on the bitmap that I would like to load into my List box. I'm just not sure how create an Imagelist and display it in the List box.
Any help would be much appreciated!
Thank You!
|
|
|
|
|
JG53_Jaguar wrote: and I use other elements from the bitmap file to draw on the screen.
I have never done that but I would believe using that same approach you can create an image object for each one and add it to an image list.
led mike
|
|
|
|
|
that's what I have been thinking as well...might have to create a small bitmap and just dump one image into it at the time and then add it to the list before moving on to next one...
|
|
|
|
|
Why you dont use of CListCtrl?
|
|
|
|
|
I don't see CListCtrl being any different, the challenge is assigning the specific regions of the bitmap and assign it to each element in the ImageList that's the challenge for me...
modified on Tuesday, April 15, 2008 10:49 AM
|
|
|
|
|
JG53_Jaguar wrote: I don't see CListCtrl being any different
Correct, it's not.
led mike
|
|
|
|
|
You can either break the bitmap into bits and get windows to handle it, or you do do owner draw, and just plot different parts of the bitmap. You already know how to draw bits on the screen, so it won't be much harder.
There should be plenty of owner draw examples on CP, and even some simple ones (which is all you're after) on MSDN.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Thanks Ian, I will look into it...I want to keep things as simple as possible. So I will try first assigning the bitmap bits to a bitmap for the imagelist one at the time first and see how that goes.
|
|
|
|
|
Hello,
Do you know any registry key that says which Operating System we are using?
Thanks! 
|
|
|
|
|
Why bother reading the registry when there is an API call that retrieves that information? GetVersionEx[^]
Judy
|
|
|
|
|
Thanks!!! 
|
|
|
|
|
I have a mfc application that i run with different resolution. So i want to change size of controls as resolutions rate.
When the resolution increases, size of controls and font must increase with same rate between new and old resolution. please tell me how to make it simply. Thanks 
|
|
|
|
|
You can use of WM_SIZE and MoveWindow or SetWindowPos.
|
|
|
|
|
There are loads of articles on codeproject that relate to this.
They're aimed at windows that change size as the user drags the edges with the mouse, but that's no different in principle.
If you mean the dpi changes, then you can MapDialogRect to make your app like a dialog box, and change size proportional to DPI.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Couldn't get any input from the "Mobile Development" board, so now I turn to the COM giants here
The docs on this are sparse, to say the least...
My problem: I'm trying to embed a WebBrowser object in a Windows Mobile application. I can create it and query its size and window handle, but IWebBrowser2::Navigate2 fails with E_FAIL .
Can anyone give me any hints to why it fails?
Code (yes, C++):
My host control is declared like this:
class HtmlControl : public Window
{
public:
HtmlControl(HWND window)
: Window(window)
, iOleObject_(NULL)
{
iOleSite_.host = this;
iOleFrame_.host = this;
CreateWebControl();
}
Site iOleSite_;
Frame iOleFrame_;
IOleObject* iOleObject_;
private:
void CreateWebControl();
}; Where Site and Frame are declared like this:
struct Site : public IOleClientSite,
public IOleInPlaceSite
{
HtmlControl* host;
STDMETHODIMP QueryInterface(REFIID riid, void** ppvObject);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
STDMETHODIMP SaveObject();
STDMETHODIMP GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker,
IMoniker** ppmk);
STDMETHODIMP GetContainer(LPOLECONTAINER FAR* ppContainer);
STDMETHODIMP ShowObject();
STDMETHODIMP OnShowWindow(BOOL fShow);
STDMETHODIMP RequestNewObjectLayout();
STDMETHODIMP GetWindow(HWND FAR* lphwnd);
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
STDMETHODIMP CanInPlaceActivate();
STDMETHODIMP OnInPlaceActivate();
STDMETHODIMP OnUIActivate();
STDMETHODIMP GetWindowContext(LPOLEINPLACEFRAME FAR* lplpFrame,
LPOLEINPLACEUIWINDOW FAR* lplpDoc,
LPRECT lprcPosRect,
LPRECT lprcClipRect,
LPOLEINPLACEFRAMEINFO lpFrameInfo);
STDMETHODIMP Scroll(SIZE scrollExtent);
STDMETHODIMP OnUIDeactivate(BOOL fUndoable);
STDMETHODIMP OnInPlaceDeactivate();
STDMETHODIMP DiscardUndoState();
STDMETHODIMP DeactivateAndUndo();
STDMETHODIMP OnPosRectChange(LPCRECT lprcPosRect);
};
struct Frame : public IOleInPlaceFrame
{
HtmlControl* host;
STDMETHODIMP QueryInterface(REFIID riid, void** ppvObject);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
STDMETHODIMP GetWindow(HWND FAR* lphwnd);
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
STDMETHODIMP GetBorder(LPRECT lprectBorder);
STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS pborderwidths);
STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS pborderwidths);
STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject* pActiveObject,
LPCOLESTR pszObjName);
STDMETHODIMP InsertMenus(HMENU hmenuShared,
LPOLEMENUGROUPWIDTHS lpMenuWidths);
STDMETHODIMP SetMenu(HMENU hmenuShared, HOLEMENU holemenu,
HWND hwndActiveObject);
STDMETHODIMP RemoveMenus(HMENU hmenuShared);
STDMETHODIMP SetStatusText(LPCOLESTR pszStatusText);
STDMETHODIMP EnableModeless(BOOL fEnable);
STDMETHODIMP TranslateAccelerator(LPMSG lpmsg, WORD wID);
}; The implementations of Site and Frame will be provided if needed, so that this space isn't cluttered too much.
So, the interesting function here is HtmlControl::CreateWebControl() . Let's walk it through, so that the possible strangeness of the IWebBrowser2::Navigate2 failure can be better seen.
First, an instance of the WebBrowser COM object is created and its associated IOleObject is retrieved:
IUnknown* iUnknown = NULL;
HRESULT hr = ::CoCreateInstance(CLSID_WebBrowser,
NULL,
CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER,
IID_IUnknown,
(void*)(&iUnknown));
VERIFY(SUCCEEDED(hr));
hr = iUnknown->QueryInterface(IID_IOleObject, (void*)(&iOleObject_));
VERIFY(SUCCEEDED(hr)); These operations were all successful in the sense that hr == S_OK .
After getting the WebControl object, I want to show/activate it using our IOleClientSite implementation:
hr = iOleObject_->SetClientSite(&iOleSite_);
VERIFY(SUCCEEDED(hr));
const RECT rect = GetClientRect();
hr = iOleObject_->DoVerb(OLEIVERB_SHOW, NULL, &iOleSite_, 0, GetHwnd(), &rect);
VERIFY(SUCCEEDED(hr)); These operations were also successful in the sense that hr == S_OK . However, the end result (the IWebBrowser2::Navigate2 failure) occurs also if OLEIVERB_SHOW is changed to OLEIVERB_UIACTIVATE or OLEIVERB_INPLACEACTIVATE .
Next, I dig the IWebBrowser2 out of the WebControl object and checks if the browser HWND is sane:
IWebBrowser2* iWebBrowser = NULL;
hr = iOleObject_->QueryInterface(IID_IWebBrowser2, (void**)&iWebBrowser);
VERIFY(SUCCEEDED(hr));
HWND hwndBrowser = NULL;
hr = iWebBrowser->get_HWND((long*)&hwndBrowser);
VERIFY(SUCCEEDED(hr));
VERIFY(hwndBrowser != NULL);
VERIFY(::GetParent(hwndBrowser) == GetHwnd());
IOleWindow* iOleWindow = NULL;
hr = iOleObject_->QueryInterface(IID_IOleWindow, (void*)(&iOleWindow));
VERIFY(SUCCEEDED(hr));
hwndBrowser = NULL;
hr = iOleWindow->GetWindow(&hwndBrowser);
VERIFY(hwndBrowser != NULL);
VERIFY(::GetParent(hwndBrowser) == GetHwnd()); Again, these operations were successful in the sense that hr == S_OK . Also, the browser HWND is equal in both method 1 and 2 and its parent is indeed our host control. I see this as some kind of indication that something works.
But... the thing I need doesn't work; the precious IWebBrowser2::Navigate2 :
VARIANT vURL;
vURL.vt = VT_BSTR;
vURL.bstrVal = ::SysAllocString(L"about:blank");
VARIANT vEmpty;
vEmpty.vt = VT_EMPTY;
hr = iWebBrowser->Navigate2(&vURL, &vEmpty, &vEmpty, &vEmpty, &vEmpty);
VERIFY(SUCCEEDED(hr)); Now I get hr == E_FAIL .
I cannot really see the problem, since everything up to this point worked successfully, and the last call seems trivial.
Is anyone still around all the way down here with some guess as to what might be going on?
Thanks for any input!
--
Time you enjoy wasting is not wasted time - Bertrand Russel
|
|
|
|
|
There's a article here on how to host the web browser via C code and the author does an *EXCELLENT* job of walking you through exactly what has to happen - try and look for that, maybe it will off you hints as to what's missing.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|