|
Do u mean that if i use createDIBSection api,i can get the pointer to access the bits.
Please all tell the procedures.i have just initialized the bitmap info header.Afterwards i dontknow what to do.
|
|
|
|
|
BITMAPINFO bmInfo;
memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
bmInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
bmInfo.bmiHeader.biWidth=width;
bmInfo.bmiHeader.biHeight=height;
bmInfo.bmiHeader.biPlanes=1;
bmInfo.bmiHeader.biBitCount=24;
HDC pDC = ::GetDC(0);
HDC TmpDC=CreateCompatibleDC(pDC);
BYTE *pbase;
HBITMAP TmpBmp=CreateDIBSection(pDC,
&bmInfo,DIB_RGB_COLORS,(void**)&pbase,0,0);
HGDIOBJ TmpObj=SelectObject(TmpDC,TmpBmp);
|
|
|
|
|
I have created an image transfer system using the UK GSM network. When the send and receive ends are both on my desk (both modems in the same GSM cell), then I have no problems at all, the system and the software work perfectly.
However, as soon as the ends are separated by any reasonable distance (in to a new GSM cell) the system falls over. Having done some extensive playing aroundtesting I have managed to discover that the modems response to dialing any out of cell number is 'NO CARRIER'. Unfortunately I have very little comm.s experience and even less experience with GSM comm.s.
I can write the most clever code in the world, but if I can't get a call to connect it's a waste. Does anyone have any ideas as to what's occurring here?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
How do I do it? :-P
I want to enable copying from a CScrollView derived class the selected data in text format. The clipboard stuff I can do, but what is bugging me is whether I really have to code the selection stuff myself.
|
|
|
|
|
Anonymous wrote:
what is bugging me is whether I really have to code the selection stuff myself.
Yes, you'll have to do that yourself. What kind of information are you displaying in CYourView?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Thanks for your answer, even though it is not what I wanted to hear .
The document content is just plain text.
|
|
|
|
|
Anonymous wrote:
The document content is just plain text.
You may consider switching to CEditView or CRichEditView then.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Hello,
I am writing a dialog based application in VC++ 6.0.
I need to execute a dos program at one point in the program and use the file generated by the DOS program. Please tell me if you know how to execute a DOS program from my VC++ code. Thanks !!
I really appreciate your input on this.
Thanks you!
Sincerely,
Anjum.
|
|
|
|
|
Still using old 16bit DOS apps? Puh!
However, a 16bit app is started as any other app either using ShellExecute(Ex)() or CreateProcess() APIs.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Hello,
I am writing a dialog based application using VC++ 6.0. It is almost complete. Now I need to change the color of all the dialog boxes and all the buttons on it from normal Grey to Some other color. I am using the funtion SetDialogBkColor() in my initInstance to change the background color .. but all the buttons etc. remain grey. Pleas suggest a way that I can change the color of all the buttons to something other color other than grey.
I really appreciate your effor in solving this problem.
Thanks!
Sincerely,
anjum.
|
|
|
|
|
the standard window buttons can't be changed in color... however they can be owner-drawn... check some articles on this site ... Controls - Buttons for example, is a section which contains lots of good info on this subject
- Roman -
|
|
|
|
|
Hi,
How can i read the unicode string from a file line by line?
Text contents will be something like this:
English string chines string
Thanks
Neha
|
|
|
|
|
first you check the first two bytes of the file... if they are 0xFF and 0xFE, respectively, the file is little endian unicode... meaning that every character in the string is two bytes and that the value (up to 65535) is a little endian "short"... if the first two bytes are 0xFE and 0xFF then the file is big endian unicode, meaning that each character is a big endian "short" value... if the first two bytes are anything else, it's not unicode
NOTE: i'm not sure about UTF-8, i never figured out the byte pattern for that format
- Roman -
|
|
|
|
|
in my application ,i want to use edit control to input text
and i want to change the font of text in the edit control.
my quesion:how can i change the edit control's width and height
accoding to the font size?
thanks.
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
I think MoveWindow() can do this!
In vckbase I also found your question!
|
|
|
|
|
In release build my exe is crashing while invoking a dialog, its crashing in ::CreateDialogIndirect() function.
Can anybody help me.
I got two Extention dlls, one DllOne.dll and another DllTwo.dll. I am handling menu clicks into DllOne.dll's mainfrm.cpp. into a function called Fun1(). In Fun1() i am trying to invoke a dialog from DllTwo.dll. There are two Dialogs into DllTwo.dll, For first Dialog its working fine in Release Build but the second one is not working (crashing into CreateDialogIndirect()). Both of these dialogs are working perfect in Deug build. Please Help
Thanks
|
|
|
|
|
supply us with some more info or just debug it (put a break point on it)
- Roman -
|
|
|
|
|
I got one extension dll, with its own resources. It is having two dialog into its resource. i am invoing these two dialogs on menu click. I handled it in mainfrm.cpp. Its not at all giving any problem to first dialog invocation but it is crashing in second dialog invocation.
|
|
|
|
|
|
tried AFX_MANAGE_STATE also.. Not Working
I got two Extention dlls, one DllOne.dll and another DllTwo.dll. I am handling menu clicks into DllOne.dll's mainfrm.cpp. into a function called Fun1(). In Fun1() i am trying to invoke a dialog from DllTwo.dll. There are two Dialogs into DllTwo.dll, For first Dialog its working fine in Release Build but the second one is not working (crashing into CreateDialogIndirect()). Both of these dialogs are working perfect in Deug build. Please Help
|
|
|
|
|
|
Try using AFX_MANAGE_STATE(AfxGetStaticModuleState()); at the beginning of the dll function in which you are aceessing the dialog.
|
|
|
|
|
Hi all,
I am accessing remote database by using ADO RDS. I am accessing Oracle database. I am getting an error message Object/Module not found. Pl can anyone help me where i am getting the problem. I am enclosing the source code of the prg. Its was the sample prg given in MSDN. I have modified according to my requirements i.e modified the server name,dsn,username.
Its there any other alternative to access remote database other than ADO RTS.
I am getting the exception in this statement.
/*****************
hr = _com_dispatch_method(pDF, dispids[0], DISPATCH_METHOD,VT_DISPATCH, (void*) &tempPtr, L"\x0008x0008\x0003",(BSTR) bstrConnect, (BSTR)bstrSQL, 0L);
**********************/
Pl. help me. Its very urgent.
#include <stdio.h>
#include <tchar.h>
#include <objbase.h>
#import "c:\program files\common files\system\ado\msado15.dll" rename("EOF", "adoEOF") rename("BOF", "adoBOF")
#import "c:\program files\common files\system\msadc\msadco.dll"
#import "c:\program files\common files\system\msadc\msadcf.dll"
#pragma warning(disable:4786; disable:4715)
const int MAX_FIELDS = 10; // Max # of Fields
HRESULT InitDataSpace(RDS::IDataspacePtr& pDS);
HRESULT InitDataFactory(RDS::IDataspacePtr pDS, _bstr_t Server, IDispatchPtr& pIDF);
HRESULT GetDISPID( DISPID& dspid, LPOLESTR FunctionName, IDispatch * obj);
HRESULT GetSRVset(ADODB::_RecordsetPtr& pRS, _bstr_t Server, _bstr_t ConnectStr, _bstr_t SQLStr);
HRESULT FlushChanges(IDispatchPtr& pIDF, DISPID funcID, _bstr_t ConnectStr, ADODB::_RecordsetPtr pRS);
void ReadRecordset(ADODB::_RecordsetPtr pRecordset);
void AddRecord(_variant_t FieldValues[], short iFieldCount, ADODB::_RecordsetPtr pRecordset);
extern "C" int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
HRESULT hResult = CoInitialize(NULL);
ADODB::_RecordsetPtr Authors;
_bstr_t bstrServer;
_bstr_t bstrConnect;
_bstr_t bstrSQL;
_variant_t Values[4]; // Holds data for AddRec
RDS::IDataspacePtr pDS;
IDispatchPtr pIDF; // Will hold Data Factory Object
DISPID SubmitChanges; // DISPID for the function
bstrServer = "http://god";
bstrConnect = " Provider=MSDAORA;dsn=newestudy;uid=estudy;pwd=estu
dy;";
bstrSQL = "Select INSPASSWD from insapplicants";
HRESULT hrResult;
// Get the DISPID for SubmitChanges
hrResult = InitDataSpace(pDS);
hrResult = InitDataFactory(pDS, bstrServer, pIDF);
LPOLESTR FName = {OLESTR("SubmitChanges")};
hrResult = GetDISPID( SubmitChanges, FName, pIDF);
// Get the Recordset
hrResult = GetSRVset( Authors, bstrServer, bstrConnect, bstrSQL);
// Read the Recordset
ReadRecordset(Authors);
pIDF.Release();
pDS.Release();
Authors->Close();
Authors.Release();
CoUninitialize();
return 0;
}
void dump_com_error(_com_error &e)
{
printf(_T("Exception!\n"));
printf(_T("\a\tCode = %08lx\n"), e.Error());
printf(_T("\a\tCode meaning = %s\n"), e.ErrorMessage());
printf(_T("\a\tSource = %s\n"), (LPCTSTR) e.Source());
printf(_T("\a\tDescription = %s\n"), (LPCTSTR) e.Description());
}
HRESULT InitDataFactory(RDS::IDataspacePtr pDS, _bstr_t bstrServer, IDispatchPtr& pIDF)
{
HRESULT HR;
_variant_t Result;
try
{
Result = pDS->CreateObject(_bstr_t ("RDSSERVER.DataFactory"), bstrServer);
HR = Result.pdispVal->QueryInterface(_uuidof(IDispatch), (LPVOID *)&pIDF);
}
catch (_com_error &e)
{
MessageBox(NULL,e.ErrorMessage(),"",0);
printf(_T("Exception!\n"));
printf(_T("\a\tCode = %08lx\n"), e.Error());
printf(_T("\a\tCode meaning = %s\n"), e.ErrorMessage());
printf(_T("\a\tSource = %s\n"), (LPCTSTR) e.Source());
printf(_T("\a\tDescription = %s\n"), (LPCTSTR) e.Description());
dump_com_error(e);
}
return HR;
}
HRESULT InitDataSpace(RDS::IDataspacePtr& pDS)
{
// This function inputs a pointer, and then initializes it
HRESULT hr;
hr = pDS.CreateInstance(_uuidof(RDS:ataSpace));
return hr;
}
HRESULT GetDISPID( DISPID& dispid, LPOLESTR FunctionName, IDispatch * obj)
{
HRESULT hr;
hr = obj->GetIDsOfNames(IID_NULL, &FunctionName, 1, LOCALE_SYSTEM_DEFAULT, &dispid);
return hr;
}
HRESULT FlushChanges(IDispatchPtr& pIDF, DISPID funcID, _bstr_t ConnectStr, ADODB::_RecordsetPtr pRS)
{
HRESULT hr;
try
{
hr = _com_dispatch_method(pIDF, funcID, DISPATCH_METHOD,
NULL, NULL, L"\x0008\x0009",
(BSTR) ConnectStr, (IDispatch *) pRS);
}
catch (_com_error &e)
{
dump_com_error(e);
}
return hr;
}
HRESULT GetSRVset(ADODB::_RecordsetPtr& pRS, _bstr_t bstrServer, _bstr_t bstrConnect, _bstr_t bstrSQL)
{
HRESULT hr;
RDS::IDataspacePtr pDS;
IDispatchPtr pDF; // Used for the DataFactory
IDispatch * tempPtr;
_variant_t Result;
try
{
hr = pDS.CreateInstance(_uuidof(RDS:ataSpace));
Result = pDS->CreateObject(_bstr_t ("RDSSERVER.DataFactory"), bstrServer);
hr = Result.pdispVal->QueryInterface(_uuidof(IDispatch), (LPVOID *) &pDF);
LPOLESTR Funky[1] = {OLESTR("Query")}; // name of the function to call
DISPID dispids[1]; // will hold the DISPID for the function
hr = pDF->GetIDsOfNames(IID_NULL, Funky, 1, LOCALE_SYSTEM_DEFAULT, dispids);
hr = _com_dispatch_method(pDF, dispids[0], DISPATCH_METHOD,
VT_DISPATCH, (void*) &tempPtr, L"\x0008\x0008\x0003",
(BSTR) bstrConnect, (BSTR)bstrSQL, 0L);
tempPtr->Release();
return hr;
}
catch (_com_error &e)
{ MessageBox(NULL,e.ErrorMessage(),"",0);
dump_com_error(e);
}
}
void AddRecord(_variant_t FieldValues[], short iFieldCount, ADODB::_RecordsetPtr pRecordset)
{
pRecordset->AddNew();
for (short i = 0; i < iFieldCount; i++)
{
pRecordset->Fields->Item[i]->Value = FieldValues[i];
}
}
void ReadRecordset(ADODB::_RecordsetPtr pRecordset)
{
pRecordset->MoveFirst();
while (!pRecordset->adoEOF)
{
for (short i = 0; i < pRecordset->Fields->Count; i++)
{
_bstr_t bstrName = pRecordset->Fields->Item[i]->Name;
_variant_t varValue = pRecordset->Fields->Item[i]->Value;
LPCTSTR lpszName = (LPCTSTR) bstrName;
_bstr_t bstrValue(varValue);
LPCTSTR lpszValue = (LPCTSTR) bstrValue;
if(i==0)
_tprintf(_T("\n"));
_tprintf(_T("%s: %s\n"), lpszName, lpszValue);
}
pRecordset->MoveNext();
}
}
Regards,
Praveena
Smile a while to keep your sorrow a mile
|
|
|
|
|
Hello,
I have never given any beautiful look to my apps. since they are used to move machines and to control their movements.
Now that I have some time I would do it, but I don't know if I can use icons from the Microsoft library "SHELL32.dll" and so others...
Is it legal to use them?
best regards.
|
|
|
|
|
I have a windows gdi region (or even a gdi+ region) and I am trying to determine an intersection point on its edge from a line constructed between the region's centre and another point outside of the region. Is this possible?
I know there are functions to determine whether or not a point lies within a region or not, but this only leaves me with the brute force method. I could iterate pixel by pixel from the outlying point up to the region's centre point until ::PtInRegion() changes from returning true to returning false. But this seems rather innefficient.
Please help!
Thankx,
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|