|
Hello, the codegurus around the world.;)
Technically, this is possible since Paul Dilascia in MSDN Magazine posted the code
to show CHtmlView on the dialog based application about one year ago?
However, I forgot the back number, but try to find the article in MSDN home page.
http://msdn.microsoft.com/msdnmag
Also, I have read the article that someone succeeded in showing CView
on the dialog at the newsgroup of Microsoft.
Good luck.
-Masaaki Onishi-
|
|
|
|
|
Check out this one
http://www.microsoft.com/MSJ/0100/c++/c++0100.asp
Cheers
Kannan
|
|
|
|
|
How to make a new DSN during the instalation with InstallShield.
|
|
|
|
|
One method(and you didn't here it from me) is to create the appropriate registry entries under the HKLM(for System DSN) or HKCU(for User DSN) \Software\ODBC... look at existing registry keys for the appropriate values to use for your DSN. This isn't recommended because the registry may change and your install won't know it...
I'm not very familiar with Install Shield, but I do know that they allow you to create scripts that can call functions in dll's...
Try your hand at using the following ODBC API functions from your install shield script:
BOOL SQLConfigDataSource(
HWND hwndParent,
WORD fRequest,
LPCSTR lpszDriver,
LPCSTR lpszAttributes);
This function declaration and some of the #defines you'll need are in odbcinst.h. I can't remember which odbc dll it resides in, but I'm pretty sure it's on any machine that uses odbc.
This function will create an ODBC datasource, but it's behavior seems to vary from database to database, ie: if there's not enough data in your lpszAttributes parameter, a dialog may show prompting for the rest of the data, or the function may fail... depends on your database software...
Sample use(from docs):
SQL_RETCODE rc;
UCHAR *szDriver = "SQL Server";
UCHAR *szAttributes =
"DSN=MyDSN\0DESCRIPTION=SQLConfigDSN Sample\0"
"SERVER=MySQL\0ADDRESS=MyServer\0NETWORK=dbmssocn\0"
"DATABASE=pubs\0";
rc = SQLConfigDataSource(NULL, ODBC_ADD_DSN, szDriver, szAttributes);
-Good luck!
|
|
|
|
|
Hi,
I need to implement an ActiveX control text editor that draws a line at the end of each paragraph. I guess my two alternatives are either to start from scratch, or subclass something like the RichEdit control. I've had a look through various articles on subclassing but I haven't found anything that would give me a clue as to where to start for this kind of thing. Can anyone suggest something that I might take a look at to get started, or is this really a case of writing the whole thing from the ground up?
Thanks,
Richard.
|
|
|
|
|
I have a jpg loaded as IPicture. I was using it to show a photo. Now I want to save this photo as bitmap. How can i do this ? IPicture::SaveasFile does not seem to be useful.
Thanks
|
|
|
|
|
hi,
For storing the screen(client area) content as bitmap,there is a article in MSDN under ...
Platform SDK/Graphics And Multimedia Services/Windows GDI/Bitmaps/Using Bitmaps/Storing an Image
Hope this helps
Cheers
Kannan
|
|
|
|
|
I get this error message when I call a function in a MFC-Extension Dll (in Release-Mode) while debugging my MFC-Application.
If both (App and Dll) are in the same state (debug or release) everything is fine. I was able to reduce the problem to only a few lines of code. However I can not see what should be wrong in my program.
To reproduce this problem create an extension Dll and add the two files foo.h and foo.cpp
----- foo.h
IMP_EXP void Foo(CString& sVal);
----- foo.cpp
#include "stdafx.h"
#define IMP_EXP __declspec(dllexport)
#include "foo.h"
void Foo(CString& sVal)
{
sVal = "12345";
}
----- end of foo.cpp
Then create a MFC-App and include the following lines
----- any cpp-file of your app
#define IMP_EXP __declspec(dllimport)
#include "[Your Path]\Foo.h"
#pragma comment(lib, "[Your Dll-Name]")
void MyFunc()
{
CString str;
str.Empty();
Foo(str);
}
Thanks for your help
Rainer
|
|
|
|
|
Release and debug MFC use different and incompatible memory allocators. What you're seeing is a just result of that. You need to have all your modules built for the same mode (debug/release).
--Mike--
http://home.inreach.com/mdunn/
The Signature, back by popular demand: Buffy. Pajamas.
|
|
|
|
|
Hello Mike,
thanks a lot for your answer.
So it looks like this is "by design" but not "by desire" . Because if you have several projects using some well tested "common dlls", you usually otherwise don't need these in debug and release mode, while debugging one of your apps.
Rainer
By the way: Thank you very much for your wonderfull tutorials ! ! ! !
|
|
|
|
|
Hi.
I have a chechbox to maik a dialog as always ontop.
But I do not know what properties or metod is for IT.
please Help me .
Thanks a lot.
|
|
|
|
|
Use SetWindowPos() with HWND_TOPMOST for the hwndInsertAfter parameter.
|
|
|
|
|
this is how I do it......
Add a control handler for when the Control is clicked
ON_BN_CLICKED(IDC_ALWAYSONTOP, OnAlwaysontop)
and the OnAlwaysontop as follows.....
void CSomeGenericDlg::OnAlwaysontop()
{
UpdateData(true);
if (m_AlwaysOnTop)
SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
else
SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
There's probably better ways to do it, but this works, and it will set the "Always on Top" state immediately when the box is checked...
Liam O'Hagan
Senior Test Engineer
GLI Australia
www.gli.com.au
|
|
|
|
|
Hi!
i Hope that there anyone can help me.
i need to save images from the computer to a file in format jpg or gif
or in the worst case Bmp, or convert the Bmp to jpg later and svae it to file.
if you have any ideas how to do it plz answer .
pascal.
|
|
|
|
|
hi,
I'm afraid there are some licensing issues when it comes to saving it as GIF.
But for jpg you can go for Intel's Image processing library
For storing the screen content as bitmap,there is a article in MSDN under ...
Platform SDK/Graphics And Multimedia Services/Windows GDI/Bitmaps/Using Bitmaps/Storing an Image
or
you can try Smaller Animals Jpeg Class
Hope this helps
Cheers
Kannan
|
|
|
|
|
I haven't any formal Bitmap file,but only a short array,then
what can I do to create and show a Bitmap with 16 bit color depth?!
Please tell me in detail!
Thanks!
fly against the wind
|
|
|
|
|
The CBitmap create method takes a pointer to the data to initialise the bitmap as it's last parameter.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
<<< In the name of GOD >>>
Hi.
How can i get IP address from my computer and server computer ?
Thanks for reply.
Hadi Rezaie
|
|
|
|
|
I am having a hard tym accessing the values
(array of strings) being returned by a function
in a DLL created in VB and place them in a VC++
combobox. The nearest I can get is dislay the
first characters of the strings in the array.
I need answers ASAP. Thanks.
(Here is the part of the code i am debugging ryt now)
void CUMNTestProgramDlg::OnDropdownCombo1()
{
HRESULT hresult;
CLSID clsid;
long lElements; // number of elements in the array
long iCount;
CString *pArrayElements; // pointer to the elements of the array
CoInitialize(NULL);
hresult=CLSIDFromProgID(OLESTR("MFCSUMNDLL.clsUMNDLL"),&clsid);
_clsUMNDLL *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_clsUMNDLL),(LPVOID *) &t);
if(FAILED(hresult))
{
AfxMessageBox("Creation Failed");
return;
}
// reset the contents of the combobox
m_cmbGroup.ResetContent();
pArrayElements = NULL;
t->ConnectForC();
// how many elements are there in the array
lElements = t->Groups()->rgsabound[0].cElements;
// locking the array before using its elements
hresult = SafeArrayLock(t->Groups());
// using the array
pArrayElements = (CString *) t->Groups()->pvData;
for (iCount=0; iCount<(lElements-2); iCount++)
m_cmbGroup.AddString((LPCTSTR) pArrayElements[iCount]);
// releasing the array
hresult = SafeArrayUnlock(t->Groups());
CoUninitialize();
}
=P
|
|
|
|
|
i think this may be your problem
// using the array
pArrayElements = (CString *) t->Groups()->pvData;
vb uses bstr's no? and they're unicode format chars no? maybe convert the bstr's to char strings before using them
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
hi. Iwant to know what commands is for access to windows registry
keys and its value.
help me pleas.
Iman Gh
Thanks a lot.
|
|
|
|
|
There a a few articles on Code Project that contain classes that simplify reading from and writing to the Registry. Check out the following link System Articles and look under the Registry sub heading.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Hi. I use string table and I like to know can I write a new
value in string table in runtime.
I want to put Edit Box value to string table.
Iman Gh
Thanks a lot.
|
|
|
|
|
Not really possible, why would you want to do that anyway?
The best thing to do (if you're using MFC) is to set up dialog data exchange so that the contents of the edit box gets put into a variable when you call UpdateDialog(). You can do this using ClassWizard, and you might want to look up Dialog Data Exchange (or DDX) in MSDN.
Hope that helps!
Andrew.
|
|
|
|
|