|
i have a function which vb is calling from my c++ dll.. the function takes a little while so i wanted to popup a dialog telling them to wait a bit.. im assuming that i cant popup a dialog from a dll as i am crashing when i tell the dialog to go modal:
INT_PTR CDialog::DoModal()
{
ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL ||
m_lpDialogTemplate != NULL);
LPCDLGTEMPLATE lpDialogTemplate = m_lpDialogTemplate;
HGLOBAL hDialogTemplate = m_hDialogTemplate;
HINSTANCE hInst = AfxGetResourceHandle(); <--- crashing here is there a built in messagebox that doesnt have an ok or cancel that i can show and hide without needing a resource? i have a progresswnd that i got here from CP, but it crashes because i pass NULL for the parent.. is there a way to tell the parent that is calling the dll's function? or a way to pass a CWND pointer from VB into my function?
thanks for ne tips!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
woops looks like i was crashin with the progress window because i left out the following in the begining of my dll's function:
AFX_MANAGE_STATE(AfxGetStaticModuleState()); woops! but for reference, is there a window built into mfc i can show and hide with no ok or cancel on it?
thanks!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
dazinith wrote:
is there a window built into mfc i can show and hide with no ok or cancel on it?
Nope. That would have made MFC more than just a wrapper class library, and (apparently) the MFC developers didn't want to work too hard.
Regards,
Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|
// All records in CObArray Pids have same data
// after for loop.
CObArray Pids;
CAPidT* T=new CAPidT; // CAPidT is public of CAPid;
CAPid* Q=new CAPid;
CString s;
int n=pDoc->m_iSelectedPids;
Pids.SetSize(n);
for(int i=0;i<n;++i)
{
="" q="(CAPid*)pDoc-">m_obaSelectedPids[i];
T->SetPid(Q);
Pids[i]=T;
}
Thanks.
|
|
|
|
|
please reformat the code. Use the < > buttons below for the <> signs because they get eaten by the codeproject beast.
After it's reformated, can you tell us what is the problem ? does it crash, does it give bad results ?
Are you sure you don't go over the array bounds in the loop ?
Thanks.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I am starting to receive driver not capable error about a week ago on one of the Oracle tables I used in the application, when doing an Update to the CRecordset.
For example:
m_pSet->Edit();
UpdateData(TRUE);
m_pSet->Update();
I have VC++ 6 Enterprise and Oracle ODBC 9.x. This problem only occurs in one table.
-Elizabeth
Eilzabeth
|
|
|
|
|
Hmmmm, it sure smells as though you don't have UPDATE privileges on the table.
Regards,
Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|
I am not sure what was causing it. For sure it is not the update privilege. After I reset the filter (m_pSet->m_strFilter = ""; m_pSet->Requery(); and did some m_pSet->MoveNext() to get to the record), I was able to do an update successfully.
Driver not capable does not tell me any information about why sometimes I can't do an Update().
|
|
|
|
|
I am not sure what was causing it. For sure it is not the update privilege. After I reset the filter (m_pSet->m_strFilter = ""; m_pSet->Requery(); and did some m_pSet->MoveNext() to get to the record), I was able to do an update successfully.
Driver not capable does not tell me any information about why sometimes I can't do an Update().
Eilzabeth
|
|
|
|
|
After an EDIT(0 ,there should not be any call to Move XXX() functions .Did u try the function canupdate() function
|
|
|
|
|
There was not a Move function after Edit function. However, I didn't check if the record set CanUpdate. Does CanUpdate give me a more specific reason instead of Driver not capable?
Eilzabeth
|
|
|
|
|
I am trying to access an html file which is in the same directory as the .exe of the program, but whenever i nav there it adds http:// to the url. I do not want to use the full file://c:/... extension but would like to do it local to the exe.
If anyone knows an easy solution could you fill me in?
I am not sure wehre they will put the exe and all that when it is on the client machine so i would like to access it in a relative url fashion, however if someone knows some code to find the current path of the program that i could use that and attache like index.htm on it.
Any help or sample code would be appreciated
|
|
|
|
|
Try using GetModuleFileName(...)
|
|
|
|
|
that got the path of the exe i have not tested it with my navigate yet because all that code is at home but i will let you know, all should be good though
thanks alot
|
|
|
|
|
Hi
I've just worked a bit with the CListCtrl but i want to have gridlines around items and subitems.
I think it's very simple, but i don't seem to find it
Greetings
Jens
|
|
|
|
|
A little sample:
DWORD dwExStyle = this->m_cLCtrlParametritzacions.GetExtendedStyle();
DWORD dwStyle = this->m_cLCtrlParametritzacions.GetStyle();
dwStyle |= LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER;
dwExStyle |= LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES; <code>this is what you want</code>
this->m_cLCtrlParametritzacions.ModifyStyle(0,dwStyle);
this->m_cLCtrlParametritzacions.SetExtendedStyle(dwExStyle); <code>Here is where the modification gets applied</code>
this->m_cilHackItemHeight.Create(1,30,ILC_COLOR,1,1);
this->m_cLCtrlParametritzacions.SetImageList(&m_cilHackItemHeight,LVSIL_SMALL);
Hope this helps...
|
|
|
|
|
m_listkiezers is a CListCtrl.
at: DWORD dwExStyle = m_listkiezers.GetExtendedStyle();
i get the following error:
error C2039: 'SetExtendedStyle' : is not a member of 'CListCtrl'
I searched for the class members for CListCtrl and 'SetExtendedStyle' was in it but it won't accept it.
Can you help me?
Thanks
Jens
|
|
|
|
|
By now I don't know what can happen...
please, post a message with the code and the version of VC++ you are using...
|
|
|
|
|
hi Joan
void CDlgM4_1::SetGridLines()
{
m_listkiezers.ModifyStyleEx(0, WS_EX_CLIENTEDGE, 0); //WS_EX_CLIENTEDGE: specifies that a window has a border with a sunken edge.
m_listkiezers.SetExtendedStyle(LVS_REPORT|LVS_EX_GRIDLINES);
}
and error here:
error C2039: 'SetExtendedStyle' : is not a member of 'CListCtrl'
I use Microsoft Developer Studio 97, Microsoft Visual C++ 5.0 (Corporate Edition)
How this helps.
Greetings from Jens
|
|
|
|
|
Hi all!
How can i connect my Win32 API application with an Access database???
|
|
|
|
|
Use ODBC API's ....Create a DSN and use ODBC APIs...Refer MSDN for ODBC APIs..If it is possible use MFC CRecordset object
|
|
|
|
|
|
Hey,
Is there a way that you can take the last number (one's digit) from a sum of 2 numbers added together? For example if I have numbers like 4, 8 that = 12. I only want to take the 2 though. Is this possible?
Thanks
Matt
Matt Millican
http://www.internetmill.com
|
|
|
|
|
#include < math.h>
int a = 8;
int b = 4;
int lastDigit = (a + b) - (int)pow(10, (int)log10(a + b)));
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
Chris Losinger wrote:
int lastDigit = (a + b) - (int)pow(10, (int)log10(a + b)));
I guess I didn't think of it that way
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|