Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

190 Neutral

About WizHarDx

  • Rank
  1. WizHarDx

    Poll question

    "If the brain were so simple that we could understand it then we'd be so simple that we couldn't" - Lyall Watson cheers Iain Fraser
  2. Here is the situation ive been making a database for night life. I have a table venue which has information about a venue such a nightclub. I then have a table event which represents an event. The problem is an event can be frequent e.g. every tuesday its jazz night at lizard lounge. But events can also be unique e.g. John Lennon is playing on 21/06/06. Their both events and they may clash obivously the unique event should overwrite the default event. But the database has to link the event to the venue. Ive come up with some solutions but none feel correct. I was wondering if there was a standard way to deal with problems like this. One other thing to bear in mind is that an event has a sort of forum where people can post on. But the messages are only attached to a paticular night. E.g. jazz night is every tuesday so if some write's a message today it will be associatioed with the 27th of june 2006. Afterwards it can be deleted! any help whats so ever would be greatly appreciated. Thanks in advance Iain Fraser
  3. WizHarDx

    winsock 1.1 Connect

    ive read the documentation many times over: According to the documentation, both the results I got for a blocking and non blocking socket suggest that the socket is connected. I think hplus0603 must be right. Ive just ignored the problem for now b/c the socket disconnects as soon as the first recv function is called it returns 0. This is annoying because ive got these little circles at the top of the title bar of my application. Which go green when there is a connection and red when there isn't. So when its in its cradle and there is no server running its flickers from green to red. I got round this by just putting a ( n seconds) before it retry's a connection. Im gonna look into hplus0603 idea. Ill report back because im sure alot of people in the future will also find this bug. Another idea I had and I don't know where to look to see if this is true? My idea is, when your in cradle mode and you try setup a socket connection to a server on the desktop. Activesync acts like a intermediate layer. PP(pocket pc) socket to ActiveSync to Server Application this would explain why a connection is always made. Because it will always get a socket to ActiveSync. Which then trys to pass it onto the the Server Application. Is this complete and utter rubbish? thank-you again very much Iain
  4. Hi ive written a client application which runs on wince. Ive got communication working perfectly. Im currently working on the connection logic because internet connection through gprs can be lost easily due to signal loss. Anyway ive come across the most annoying error. When the pocket pc is in the cradle. If the server application isn't running on the server. The connect function is still sucessful. Ive read the connect function documentation like 20 times now. When I try both blocking and non-blocking it still indicates a connection i.e.: blocking socket = connect returns 0 nonblocking socket = connect returns SOCKET_ERROR the error is 10035 and when select is called it says the socket is writable and therefore connected I have no idea what it is. The only thing I can think of is that activesync may trick the device into thinking its connect ? thank-you very much in advance Iain Fraser
  5. WizHarDx


    umm this is intresting. I haven't read the whole thread but I have recently come across a situation where I could not immediately think of a simple way round the goto, that is in a nested loop: while(true) { if(condition) { break; // thats fine can get to the end of loop } } // but when in two loops and want to leave both if some exception in inside // loop only goto works I believe while(true) { while(true) { if(condition) { // break will only leave this function goto label; } } label: } wondering if there is a better way round this. Without having to make ridclous amount of functions i.e. put code at end of loop in another function then call that function when condition hit and return
  6. If anyone knows where I can find compiled lua libary that works with embedded visual C++ 4.0. I would really appreciate it. Ive searched the web but I keep hitting dead links. thank-you in advance Iain Fraser
  7. Hey Everyone, I found the solution to the problem. The information on this is scarce so I hope this can help someone in the future. When on msdn they say it is n boundary aligned. In this case DWORD boundary aligned. They don't mean that the total size of the record/struct/buffer should be divisible by 4. But that the memory that the record/struct/buffer must end on must be divisible by 4. So for example if you want to DWORD align a buffer the code would be: void DWORDAlign(BYTE*& pSeek) { while( (DWORD)pSeek % 4) { *pSeek++ = 0; } } So the function just keeps incrementing the memory address by a byte and setting it to 0 till the address is divisble by 4. Hope this helps in the future Iain Fraser
  8. Hey Guys, This is quite a complex problem in the fact there is a lot of code. So unless youve done this before I won't expect much :( Basically ive written a .rc file parser. Ok This converts the data in the rc file to the appriopiate DLGTEMPLATEEX & DLGITEMTEMPLATEEX which are struct you have to define your own. When I just pass a header with 0 items, the dialog appears but as soon as I put a dialog item in there the CreateDialogIndirect fails to display the dialog although the last error returns 0. So Im guessing it has something to do with the DWORD align. If you could please check my DWORD align code I would really appreciate it! [SOURCE] /////////////////////////////////////////////////////////////////////////////////////////// // Make Compatible With CreateDialogIndirect - Aligning Bytes, Packing bytes, Converting Bytes /////////////////////////////////////////////////////////////////////////////////////////// DWORD* CDialogLoad::GetDlgTemplate() { // Delete Buffer if(m_buffer) { delete [] m_buffer; m_buffer = 0; } int headersize; const int size = GetTotalSize(headersize); // Allocate Buffer m_buffer = new BYTE[size]; // Start Seek Ptr BYTE* pSeek = m_buffer; // Copy Header CopyHeader(pSeek,headersize); // Copy Items for(list<sDlgItem>::iterator it=m_items.begin();it!=m_items.end();it++) { CopyItem(pSeek,(*it),GetItemSize((*it))); } return (DWORD*)m_buffer; } int CDialogLoad::GetTotalSize(int &rHeadersize) { // Calculate Aligned Header Size const int headercharacters = (m_dlgtemplate.title.size() + 1) + (m_dlgtemplate.typeface.size() + 1); const int unalignedheadersize = sizeof(DLGTEMPLATEEX) + ( 2 * headercharacters ); int headersize = unalignedheadersize; if( headersize % 4) { headersize = ((headersize/4) + 1) * 4; // headersize += 4 - (headersize % 4); } rHeadersize = headersize; // Calculate Item Size int itemsize = 0; for(list<sDlgItem>::iterator it=m_items.begin();it!=m_items.end();it++) { itemsize+= GetItemSize( (*it) ); } return (headersize + itemsize); } int CDialogLoad::GetItemSize(sDlgItem &item) { const int itemcharacters = (item.title.size() + 1) ; const int unalignedsize = sizeof(DLGITEMTEMPLATEEX) + ( 2 * itemcharacters); int itemsize = unalignedsize; if(itemsize % 4) { itemsize = ((itemsize / 4) + 1) * 4; // itemsize += 4 - (itemsize % 4); } return itemsize; } // Copy Memory And Move Seek Pointer void CDialogLoad::CopyMove(BYTE *&src,void *dst,int size,int &totalsize) { memcpy(src,dst,size); src+=size; totalsize-=size; return; } // Convert ANSII String To Unicode, Serialize To Buffer void CDialogLoad::CopyUnicode(BYTE *&src,string value,int &totalsize) { // Allocate Buffer WORD* buffer = new WORD[value.size() + 1]; // Convert To UniCode for(int i=0;i<value.size();i++) { buffer = (WORD)value; } buffer[value.size()] = 0; // Set NULL Terminator // Pack The Unicode String CopyMove(src,buffer,( 2 * (value.size() + 1) ),totalsize); // Delete Buffer delete [] buffer; return; } // Set Memory To 0 & Move Seek Pointer void CDialogLoad::SetMove(BYTE *&src,int size) { memset(src,0,size); src+=size; return; } // Serialize header to buffer stream void CDialogLoad::CopyHeader(BYTE *&pSeek,int size) { // Copy Header Data Through Seek Pointer CopyMove(pSeek,&m_dlgtemplate.header.dlgVer,sizeof(WORD),size); CopyMove(pSeek,&m_dlgtemplate.header.signature,sizeof(WORD),size); CopyMove(pSeek,&m_dlgtemplate.header.helpID,sizeof(DWORD),size); CopyMove(pSeek,&m_dlgtemplate.header.exStyle,sizeof(DWORD),size); CopyMove(pSeek,&m_dlgtemplate.header.style,sizeof(DWORD),size); CopyMove(pSeek,&m_dlgtemplate.header.cDlgItems,sizeof(WORD),size); CopyMove(pSeek,&m_dlgtemplate.header.x,sizeof(short),size); CopyMove(pSeek,&m_dlgtemplate.header.y,sizeof(short),size); CopyMove(pSeek,&m_dlgtemplate.header.cx,sizeof(short),size); CopyMove(pSeek,&m_dlgtemplate.header.cy,sizeof(short),size); CopyMove(pSeek,&m_dlgtemplate.header.menu,sizeof(WORD),size); CopyMove(pSeek,&m_dlgtemplate.header.windowClass,sizeof(WORD),size); CopyUnicode(pSeek,m_dlgtemplate.title,size); CopyMove(pSeek,&m_dlgtemplate.header.pointsize,sizeof(WORD),size); CopyMove(pSeek,&m_dlgtemplate.header.weight,sizeof(WORD),size); CopyMove(pSeek,&m_dlgtemplate.header.italic,sizeof(BYTE),size); CopyMove(pSeek,&m_dlgtemplate.header.charset,sizeof(BYTE),size); CopyUnicode(pSeek,m_dlgtemplate.typeface,size); // Clear DWORD Boundary SetMove(pSeek,size); return; } // Serialize an item to the buffer stream void CDialogLoad::CopyItem(BYTE *&pSeek,sDlgItem& item,int size) { CopyMove(pSeek,&item.itemtemplate.helpID,sizeof(DWORD),size); CopyMove(pSeek,&item.itemtemplate.exStyle,sizeof(DWORD),size); CopyMove(pSeek,&item.itemtemplate.style,sizeof(DWORD),size); CopyMove(pSeek,&item.itemtemplate.x,sizeof(short),size); CopyMove(pSeek,&item.itemtemplate.y,sizeof(short),size); CopyMove(pSeek,&item.itemtemplate.cx,sizeof(short),size); CopyMove(pSeek,&item.itemtemplate.cy,sizeof(short),size); CopyMove(pSeek,&item.itemtemplate.id,sizeof(WORD),size); CopyMove(pSeek,&item.itemtemplate.windowClass,sizeof(WORD)*2,size); CopyUnicode(pSeek,item.title,size); CopyMove(pSeek,&item.itemtemplate.extraCount,sizeof(WORD),size); // Clear The DWORD Boundary SetMove(pSeek,size); return; } [/SOURCE] Quite a bit I know, if I get no responses its not the end of the world as I can create the controls using CreateWindow seprately and using the dialog handle. thank-you soo much in advance Iain Fraser
  9. WizHarDx

    Pocket PC

    thank-you guys Iain Fraser
  10. WizHarDx

    Pocket PC

    Hi guys, Ive been told to develop software for pocket pc by my boss. So I snooped around and I downloaded microsofts embedded visual C++. I was very confused about the sdk part, basicaly I want my software to run on any win ce device hopefully. So I just downloaded the standard SDK, assuming that later versions would be backwards compatiable. Anyway I can get the emulator working but I cannot for the life of me get it onto the device. I have active sync, The cpu of the model im working is intel(R) PXA263. Also could you please explain to me how the sdks and portablity work for windows CE. thank you very much in advance Iain Fraser
  11. WizHarDx

    Portal Engine

    thanx for the response guys. Ya Im just looking for some temporary data. I will making my own file format later as we are making a complete game from this engine. But I just need some data to test my hsr alogrithms. At the moment ive got a few cubes connected with a square hole as the portal. But this isn't going to really push my algorithm to the max. so im just looking for a temporary maps / data to load that is easy to understand and convert for what I need. Hope this clarfies what im looking for? thanx again Iain Fraser
  12. WizHarDx

    gamedev search

    Hi, I don't know if this has all ready been mentioned but I can't search for it :p . I was wondering when the forumn search was gonna come back up. It was a really useful feature and ive been patiently awaiting its re arrival regards Iain
  13. WizHarDx

    Portal Engine

    Hi, I am currently developing an indoor/outdoor engine. I want it to be like hitman 2 graphics. My current idea is to have a portal engine and every portal is divided into its own octree. This will allow the whole outdoor section to be one zone and still render effciently because of the octree. Do you think this will work or am I missing anything ? If what I assume is correct this leads me to the current problem. I understand the mathmatics and algorithms needed and I want to implement them. But I am having real trouble getting the data as there is so much needed I find im spending to much time inputting it into a file. There are usally errors and its simplicity may lead to me thinking that the HSR algorithms are working when they are not? I don't particularrly want to spend a week looking up docs loading some complex file format. Thank-you very much in advance Iain Fraser
  14. ya I know it will print garbage but we do just wanna see something at the moment. when I put binary on it doesn't even allow the file to open. When its off it only reads like 4 bytes thanks for the response Iain
  15. well guys it appears no one knows how to fix this, ill give you some information. Basically one of our files is 1.8 GB and we just want to see whats in it b/c we believe it is corrupted. So im writing this simple app to stream in 128 bytes at a time and write it. But it won't work ? please please please help me thank-you in advance Iain Fraser
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!